From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85840 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: setuphead for in-paragraph head ? Date: Thu, 9 Jan 2014 16:36:31 +0100 Message-ID: <133B935F-59FF-4C57-9A37-00B42BCAB67F@gmail.com> References: <52CEB6B4.7070308@gyza.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1389281803 24716 80.91.229.3 (9 Jan 2014 15:36:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jan 2014 15:36:43 +0000 (UTC) To: hajtmar@gyza.cz, mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 09 16:36:51 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W1Hf7-0005y8-AR for gctc-ntg-context-518@m.gmane.org; Thu, 09 Jan 2014 16:36:49 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A9067101EA; Thu, 9 Jan 2014 16:36:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Fuc-I-PxjYpJ; Thu, 9 Jan 2014 16:36:47 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E71B7101E2; Thu, 9 Jan 2014 16:36:46 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0DE45101E2 for ; Thu, 9 Jan 2014 16:36:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JFs5jpSbuFVc for ; Thu, 9 Jan 2014 16:36:40 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id E3EB7101DE for ; Thu, 9 Jan 2014 16:36:39 +0100 (CET) Original-Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s09FaYRl001853 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 9 Jan 2014 16:36:34 +0100 Original-Received: by mail-we0-f177.google.com with SMTP id x55so659113wes.36 for ; Thu, 09 Jan 2014 07:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=90BpCIrGZSk8q+p8u9v6HlqYMnpZuzkj9TOQk98jNW4=; b=X24/42AAwFwhM5CuLW2v/f7XLRKHrMmGyyzFqG3Ra1Y8gDI5UqdrfwW5VFtSo1cedR 72BM4jH5zKHvyMzhR8It0t+vDAtu7fDvjmtj6tU0CUNcj8lLPd/LIzwPDXJ8qgSUVp4g gP54AwSJ9P5Jmw8L7q0Qi/fLFwO+KKEOLoQt2fLN78FP+VgNiR2Mw4I4uJuHGRBpp8IW QAZ4BarFpOwhxyrAEpMJTP9BOKJlg+OHbsyhHl7jKgwDa2pqjJxP50JGFWLkg6MMEDd7 oC8I05y8zyhAA3Hsk8ZFGPt82tlbDKsPKKVGoNO7kgul/KX4s74Mio4i13/QTs6jjQkw lQzg== X-Received: by 10.180.206.104 with SMTP id ln8mr3881536wic.13.1389281794283; Thu, 09 Jan 2014 07:36:34 -0800 (PST) Original-Received: from [192.168.1.35] (75.218.192.77.rev.sfr.net. [77.192.218.75]) by mx.google.com with ESMTPSA id cy10sm1844264wjb.6.2014.01.09.07.36.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Jan 2014 07:36:33 -0800 (PST) In-Reply-To: <52CEB6B4.7070308@gyza.cz> X-Mailer: Apple Mail (2.1827) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c03::231; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RLbPAy8E - b84c70ff9835 - 20140109 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:85840 Archived-At: On 9 janv. 2014, at 15:48, Jaroslav Hajtmar wrote: > Hello Otared. > I will throw this one... Thanx. > > Once I was using exercise-answer package for LaTeX. > Is there anything like this to use in ConTeXt? > > Thanx > Jaroslav Hajtmar Hello Jaroslav, I have something like the following which was given to me by Hans a long time ago: unfortunately for some reason this does not work anymore with ConTeXt mkiv, but it is quite fine with mkii: %%% begin question-hint-answer.tex \defineblock[question] \defineblock[hint] \defineblock[answer] \defineenumeration[question][location=hanging,text={Question},stopper={.}] \defineenumeration[hint][location=hanging,text={Hint for question},stopper={.}] \defineenumeration[answer][location=hanging,text={Answer to question},stopper={.}] \hideblocks[hint] \hideblocks[answer] \starttext \section{Questions} \beginquestion \question Compute $4\times 5$. \beginhint \hint Use the fact that $2\times 5 = 10$. \endhint \beginanswer \answer $20$. \endanswer \endquestion \beginquestion \question What is the value of $100 / 10$? \beginhint \hint Remember that $10\times 10 = 100$. \endhint \beginanswer \answer $10$ \endanswer \endquestion \section{Hints} \useblocks[hint] \section{Answers} \useblocks[answer] \stoptext %%% end question-hint-answer.tex Best regards: OK > > > Dne 9.1.2014 15:19, Otared Kavian napsal(a): >> %%% begin example-exercise.tex >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> % defining \startexo, \stopexo as an enumeration: >> \startsetups style:simple >> \defineenumeration[exo] >> [alternative=hanging, >> width=fit, >> stopper={.}, >> text=Exercise, >> % between=, >> before=, >> after=\blank] >> \stopsetups % style:simple >> >> \startsetups style:textrule >> \definenumber[MyExoNumber][way=bysection,sectionumber=yes] >> \setuptextrules[rulecolor=darkred] >> \define\ExoCommand{\incrementnumber[MyExoNumber] >> \textrule[top]{Exercise \getnumber[MyExoNumber]} >> \startbackground[frame=off,leftframe=on,backgroundcolor=white, >> framecolor=darkred]} >> >> \defineenumeration[exo] >> [alternative=hanging, >> width=fit, >> text={}, >> number=hide, >> number=no, >> before={\ExoCommand}, >> after={\stopbackground\blank}] >> \stopsetups % style:textrule >> >> % end defining \startexo, \stopexo as an enumeration >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> %defining numbered questions >> \defineconversion[exercise][\numbers] >> %\setupitemize[packed] >> \def\StartQuestions{% >> \startitemize[exercise][width=2em,packed,style=bold,stopper=,right=)]} >> \def\StopQuestions{\stopitemize} >> \def\q{\item} >> >> % trye each of the following >> \setups[style:simple] >> %\setups[style:textrule] >> >> \starttext >> \startexo >> Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^2 = a^2 + b^2$. >> \stopexo >> >> >> \startexo >> Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^4 = a^4 + b^4$. >> \stopexo >> >> \startexo >> \StartQuestions >> \q Prove that >> \startformula >> \sum_{n=1}^\infty{1 \over n^2} = {\pi^2 \over 6}. >> \stopformula >> >> \q Prove that for any $n \geq 1$ integer one has >> \startformula >> \sum_{k=1}^n k^3 = \left({n(n+1) \over 2}\right)^2. >> \stopformula >> \StopQuestions >> \stopexo >> >> \stoptext >> %%% end example-exercise.tex > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________