From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85891 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: setuphead for in-paragraph head ? Date: Sat, 11 Jan 2014 20:01:31 +0100 Message-ID: <1CEEA7A0-3472-47A6-9AE9-C7D14CB379D4@gmail.com> References: <52CEB6B4.7070308@gyza.cz> <133B935F-59FF-4C57-9A37-00B42BCAB67F@gmail.com> <3BA99063-FA3F-449B-B022-1A2109B25A59@gmail.com> <8E7ED7B8-29C0-4865-B7A8-DD1BD09709E3@gmail.com> <759FE779-328A-4726-8D77-779D83EA097E@gmail.com> <7528AB5C-EF48-4393-869C-8DD3AA6D8C38@gmail.com> 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="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389466895 26278 80.91.229.3 (11 Jan 2014 19:01:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Jan 2014 19:01:35 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Jan 11 20:01:43 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 1W23oT-0004qZ-TM for gctc-ntg-context-518@m.gmane.org; Sat, 11 Jan 2014 20:01:41 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D319E101DE; Sat, 11 Jan 2014 20:01:40 +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 r50yWnjl0BFD; Sat, 11 Jan 2014 20:01:38 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id ADAD2101E2; Sat, 11 Jan 2014 20:01:38 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8B19B101E2 for ; Sat, 11 Jan 2014 20:01:37 +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 AJNjsPefdugc for ; Sat, 11 Jan 2014 20:01:36 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 4AACB101DE for ; Sat, 11 Jan 2014 20:01:36 +0100 (CET) Original-Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s0BJ1Zda012216 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sat, 11 Jan 2014 20:01:35 +0100 Original-Received: by mail-wi0-f178.google.com with SMTP id bz8so805908wib.5 for ; Sat, 11 Jan 2014 11:01:35 -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=OUM1uQ9RKRTwfXYFI3kGCNLPuTL48w7vOby2e5aJiwY=; b=dHz4EHaiHfZoRyMygLZ5KFv6AaCzhX8V8vT1P+pEaESmVB8Bx140+ueyEcq6Mof68W qlyXnQB/cCQXeFJs9BII2DW46RZg9ttNFfLJutBYbFIPqdU1FIDTCwe/sLMSS+pGo8dr oMRgmSfaFwa3/6F6caYpuXhDjkaFXiqUBY0UbEYYLjM19qqbIcXTTrO0/eFIjVtmN+oy +2qXNmsOOXxTduEAo1Ze8WYFnI+I9CCmqXQ7J9WQtx+7InmvOqiEJuPMlns4+ZIahUxN 9nRHrBsnsp0mGE6nN2IAMx9H4xGn57NLguuzj0Zxi0l7LiGeHYUHGmUuwWu4DO7O6oxK bTKw== X-Received: by 10.194.61.84 with SMTP id n20mr184084wjr.61.1389466895007; Sat, 11 Jan 2014 11:01:35 -0800 (PST) Original-Received: from [192.168.0.20] (seg75-6-82-236-32-4.fbx.proxad.net. [82.236.32.4]) by mx.google.com with ESMTPSA id bj3sm7228743wjb.14.2014.01.11.11.01.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 Jan 2014 11:01:34 -0800 (PST) In-Reply-To: <7528AB5C-EF48-4393-869C-8DD3AA6D8C38@gmail.com> X-Mailer: Apple Mail (2.1827) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::232; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TLcH1z5l - e24c273d9580 - 20140111 (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:85891 Archived-At: Hi Wolfgang, Many thanks for your attention and insight. With your code everything works as expected. In case others would be intere= sted, I give here a slight modification of what you sent, which works very = well with mkiv: I only added = \setupblock[question][before=3D{\startquestion},after=3D{\stopquestion}] so that one can just say \beginquestion \endquestion without having to ente= r each time \startquestion \stopquestion. I don=92t know whether this is a = good idea or not, as it may have side effects=85 I will put this example on the wiki, but before doing so I have another que= stion: can one add two automatic links at the end of each question so that one can= navigate easily to the respective hint or answer corresponding to that que= stion? Indeed if this were possible, one would add also two automatic links= to each hint going to its question and the corresponding answer, and two o= ther links to each answer going to its hint and question. One can do this m= anually by adding a reference to each question, each hint and each answer, = but it would be nice to have this done automatically. Best regards: OK PS: here is the complete example for question-hint-answer: %%%% begin question-hint-answer-blocks.tex \defineblock[question] \defineblock[hint] \defineblock[answer] \defineenumeration[question] [alternative=3Dhanging, width=3D2.5cm, text=3D{Question}, headstyle=3D{\bi}, stopper=3D{.}] = \defineenumeration[hint] [alternative=3Dhanging, width=3D4cm, text=3D{Hint for question}, headstyle=3D{\bi}, stopper=3D{.}] \defineenumeration[answer] [alternative=3Dhanging, width=3D4.5cm, text=3D{Answer to question}, headstyle=3D{\bi}, stopper=3D{.}] \setupblock[question][before=3D{\startquestion},after=3D{\stopquestion}] \setupblock[hint][before=3D{\starthint},after=3D{\stophint}] \setupblock[answer][before=3D{\startanswer},after=3D{\stopanswer}] \keepblocks[question] \hideblocks[hint] \hideblocks[answer] \starttext \section{Questions} \beginquestion Compute $4\times 5$. \endquestion \beginhint Use the fact that $2\times 5 =3D 10$. \endhint \beginanswer $20$. \endanswer \beginquestion What is the value of $100 / 10$? \endquestion \beginhint Remember that $10\times 10 =3D 100$. \endhint \beginanswer $10$ \endanswer \section{Hints to all questions} \useblocks[hint] \section{Answers to all questions} \useblocks[answer] \stoptext %%%% end question-hint-answer-blocks.tex On 11 janv. 2014, at 10:12, Wolfgang Schuster = wrote: > = > Am 11.01.2014 um 00:36 schrieb Otared Kavian : > = >> Hi Wolfgang, >> = >> In mkiv, even using \startanswer, \stopanswer (and the same syntax with = questions and hints) the blocks mechanism seems to be broken. >> The error message is still the following: >> = >> \dostopnormalblock ...meter \c!after \par \egroup = >> = >> ...fact that $2\times 5 =3D 10$. \dostopnormalblock = >> \dostartnormalblock {h= int}... >> \dodowithpar ...dler \v!construction \endcsname #1 >> \csname \??constructio= nsto... >> = >> When I understand a little bit more about that mechanism I=92ll do other= testings and eventually ask Hans about what has been changed regarding blo= cks. > = > You have to convert the question, hint and answer environment. > = > What the block environment does is to save the content from the begin to = the end block and hides it when you use \hideblocks[=85]. To output the con= tent of the environments you can use \useblocks[=85]. > = > = > \defineblock[question] > \defineblock[hint] > \defineblock[answer] > = > \defineenumeration[question][alternative=3Dhanging,text=3D{Question},stop= per=3D{.}] > \defineenumeration[hint] [alternative=3Dhanging,text=3D{Hint for quest= ion},stopper=3D{.}] > \defineenumeration[answer] [alternative=3Dhanging,text=3D{Answer to ques= tion},stopper=3D{.}] > = > \keepblocks[question] > \hideblocks[hint] > \hideblocks[answer] > = > \starttext > = > \section{Questions} > = > \beginquestion > = > \startquestion > Compute $4\times 5$. > \stopquestion > = > \beginhint > \starthint > Use the fact that $2\times 5 =3D 10$. > \stophint > \endhint > = > \beginanswer > \startanswer > $20$. > \stopanswer > \endanswer > = > \endquestion > = > \beginquestion > = > \startquestion > What is the value of $100 / 10$? > \stopquestion > = > \beginhint > \starthint > Remember that $10\times 10 =3D 100$. > \stophint > \endhint > = > \beginanswer > \startanswer > $10$ > \stopanswer > \endanswer > = > \endquestion > = > \section{Hints} > = > \useblocks[hint] > = > \section{Answers} > = > \useblocks[answer] > = > \stoptext > = > Wolfgang > = > _________________________________________________________________________= __________ > 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-co= ntext > 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 t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________