From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86422 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: solutions and problems Date: Sun, 23 Feb 2014 20:51:14 +0100 Message-ID: <8CD41798-D6F3-4C5B-A134-E7D79D44A1A1@gmail.com> References: <20140220101511.0c8fac08c374f6eb81424e44@telefonica.net> <20140220132233.a836d8f54fcf1cad6c02abd1@telefonica.net> <20140221102820.6b3cd633b35893d1a16c1ec0@telefonica.net> <20140222184537.617522aac557ab64c217971b@telefonica.net> <20140223200945.4cc7e7a24161e9dd3f367440@telefonica.net> 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: multipart/mixed; boundary="===============1132598094==" X-Trace: ger.gmane.org 1393185081 19451 80.91.229.3 (23 Feb 2014 19:51:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Feb 2014 19:51:21 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Feb 23 20:51:31 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 1WHf5H-0000Mo-5a for gctc-ntg-context-518@m.gmane.org; Sun, 23 Feb 2014 20:51:31 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6F0B1101F2; Sun, 23 Feb 2014 20:51:30 +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 aDNkN2I+WIfZ; Sun, 23 Feb 2014 20:51:29 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 02955101E3; Sun, 23 Feb 2014 20:51:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BE859101E3 for ; Sun, 23 Feb 2014 20:51:27 +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 iFKgytsG-4mS for ; Sun, 23 Feb 2014 20:51:26 +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 76A80101E1 for ; Sun, 23 Feb 2014 20:51:26 +0100 (CET) Original-Received: from mail-bk0-x232.google.com (mail-bk0-x232.google.com [IPv6:2a00:1450:4008:c01::232]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s1NJpE3c024052 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sun, 23 Feb 2014 20:51:25 +0100 Original-Received: by mail-bk0-f50.google.com with SMTP id d7so1586574bkh.23 for ; Sun, 23 Feb 2014 11:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=X1dgB1oNrl/k9khSt9HAXtaBDo2XGLU3WqmNtYx5IKE=; b=FTeyDvJdthw5aoH13ePx7+Fho8cEWQZ7DzZhrQhcj4+E7BREaol9oyYVrKaxStCrZ+ bnUTOeG0isCbfQXEajlxNSVo9ZTeTIvAZ434qnvcWXvZRdqB7962F3xM26Jqj5Ytd6T2 Wea+1GiOdCHHE6RGj9ubNegGS2/vhMxDQN4/ybppHX36VRYouJZeGdiPMIT3R3YshKTJ Aco2yNDYlGzwjwOVHemigJYYKcxL+r3zUkM0QdkQdgP7EdTOmGqDR5VgUbXldvMHw5d+ EAaab1Llyopj7th4eLdr1Csz95qNNqqrSdno0ReAcv7zJcmyKe4nrWbj4Brtffisc9J+ 5YBQ== X-Received: by 10.204.101.66 with SMTP id b2mr4092993bko.33.1393185074721; Sun, 23 Feb 2014 11:51:14 -0800 (PST) Original-Received: from keima.localdomain (x2f22143.dyn.telefonica.de. [2.242.33.67]) by mx.google.com with ESMTPSA id yt4sm13360047bkb.7.2014.02.23.11.51.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 11:51:13 -0800 (PST) In-Reply-To: <20140223200945.4cc7e7a24161e9dd3f367440@telefonica.net> X-Mailer: Apple Mail (2.1827) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:4008:c01::232; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RLtTPf1f - bbbc9caa8a7a - 20140223 (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:86422 Archived-At: --===============1132598094== Content-Type: multipart/alternative; boundary="Apple-Mail=_6EE8D2EE-0635-446D-9CBA-F08092F5FEC1" --Apple-Mail=_6EE8D2EE-0635-446D-9CBA-F08092F5FEC1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Am 23.02.2014 um 20:09 schrieb Xan : >> Am 22.02.2014 um 18:45 schrieb Xan : >>=20 >>> No, it does not work. >>>=20 >>> I have this: >>>=20 >>> % Questions >>> \defineenumeration >>> [exercici] >>> = [alternative=3Dserried,text=3D{\startcolor[darkblue]Exercici\stopcolor},st= opper=3D{.\space},left=3D{\bgroup},right=3D{\egroup},width=3Dfit,headstyle= =3D\ss,distance=3D0.25em,width=3Dfit,before=3D{\incrementcounter[resposta]= }] >>>=20 >>> % Answers >>> \defineenumeration[resposta][headstyle=3D\ss,text=3D{Solucions de = l'exercici = \getnumber[exercici]},width=3Dfit,alternative=3Dserried,before=3D{\decreme= ntcounter[resposta]},number=3Dno] >>>=20 >>> \defineblock[resposta] >>> \hideblocks[resposta] >>>=20 >>>=20 >>> % Exercises >>>=20 >>> \startexercici Bla... >>> \beginresposta >>> \resposta (Solucions: \startitemize[a,text] \item D, \item I, \item = D, \item No t=E9 relaci=F3, \item D, \item D, \item No t=E9 relaci=F3, = \item No t=E9 relaci=F3, \item D.\stopitemize) \par >>> \endresposta >>> \stopexercici >>>=20 >>> \startexercici Bla 2 >>> \stopexercici >>>=20 >>> \startexercici Bla 3 >>> \beginresposta >>> \resposta (Solucions: \startitemize[a,text] \item D, \item I, \item = D, \item No t=E9 relaci=F3, \item D, \item D, \item No t=E9 relaci=F3, = \item No t=E9 relaci=F3, \item D.\stopitemize) \par >>> \endresposta >>> \stopexercici >>>=20 >>> \subject{Answers} >>>=20 >>> \selectblocks[resposta][criterium=3Dsection] >>>=20 >>>=20 >>> I get \getnumber[exercici] as the last, not the counter of = 'exercici' in which I have the answer. How can I do thaT? >>=20 >> Make a complete minimal example. >>=20 >> Wolfgang >=20 >=20 > Simply put starttext and stoptext. Here it=92s: For a minimal example you don=92t need so many setups for the = enumerations and also text should be kept to a minimum. > Can you help me? Your counter settings are useless because context stores only the = environment plus content for the answers, nothing is done with them at = this point. When you flush the answer blocks context sees them for the = first time and the counter for the questions is 3 at this point and this = is why you get always the same value. \defineenumeration[exercici][text=3DExercici] \defineenumeration[resposta][text=3DSolucions] \defineblock[resposta] \hideblocks[resposta] \starttext \startexercici Question 1 \beginresposta \resposta Answer 1 \par \endresposta \stopexercici \startexercici Question 2 \beginresposta \incrementcounter[resposta] \endresposta \stopexercici \startexercici Question 3 \beginresposta \resposta Answer 3 \par \endresposta \stopexercici \subject{Answers} \selectblocks[resposta] \stoptext Wolfgang --Apple-Mail=_6EE8D2EE-0635-446D-9CBA-F08092F5FEC1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252
Am 23.02.2014 um 20:09 schrieb Xan = <dxpublica@telefonica.net>:=

Am = 22.02.2014 um 18:45 schrieb Xan <dxpublica at telefonica.net>:

No, it does not work.

I have this:

% = Questions
\defineenumeration
[exercici]
[alternative=3Dserried,te= xt=3D{\startcolor[darkblue]Exercici\stopcolor},stopper=3D{.\space},left=3D= {\bgroup},right=3D{\egroup},width=3Dfit,headstyle=3D\ss,distance=3D0.25em,= width=3Dfit,before=3D{\incrementcounter[resposta]}]

% = Answers
\defineenumeration[resposta][headstyle=3D\ss,text=3D{Solucions = de l'exercici = \getnumber[exercici]},width=3Dfit,alternative=3Dserried,before=3D{\decreme= ntcounter[resposta]},number=3Dno]

\defineblock[resposta]
\hidebl= ocks[resposta]


% Exercises

\startexercici = Bla...
\beginresposta
\resposta (Solucions: \startitemize[a,text] = \item D, \item I, \item D, \item No t=E9 relaci=F3, \item D, \item D, = \item No t=E9 relaci=F3, \item No t=E9 relaci=F3, \item D.\stopitemize) = \par
\endresposta
\stopexercici

\startexercici Bla = 2
\stopexercici

\startexercici Bla = 3
\beginresposta
\resposta (Solucions: \startitemize[a,text] \item = D, \item I, \item D, \item No t=E9 relaci=F3, \item D, \item D, \item No = t=E9 relaci=F3, \item No t=E9 relaci=F3, \item D.\stopitemize) = \par
\endresposta
\stopexercici

\subject{Answers}

\sel= ectblocks[resposta][criterium=3Dsection]


I get = \getnumber[exercici] as the last, not the counter of 'exercici' in which = I have the answer. How can I do thaT?

Make a = complete minimal example.

Wolfgang


Simply = put starttext and stoptext. Here = it=92s:

For a minimal example = you don=92t need so many setups for the enumerations and also text = should be kept to a minimum.

Can you help = me?

Your counter settings are = useless because context stores only the environment plus content for the = answers, nothing is done with them at this point. When you flush the = answer blocks context sees them for the first time and the counter for = the questions is 3 at this point and this is why you get always the same = value.

\defineenumeration[exercici][text=3DE= xercici]
\defineenumeration[resposta][text=3DSolucions]

\defineblock[resposta]
\hideblocks[resposta]

\starttext

\startexercici = Question 1
\beginresposta
\resposta Answer 1 = \par
\endresposta
\stopexercici

\startexercici Question = 2
\beginresposta
\incrementcounter[resposta]
\endresposta
\stopexercici

\startexerc= ici Question 3
\beginresposta
\resposta Answer 3 = \par
\endresposta
\stopexercici

\subject{Answers}

\selectblocks[resposta]

\stoptext

Wolfgang

= --Apple-Mail=_6EE8D2EE-0635-446D-9CBA-F08092F5FEC1-- --===============1132598094== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1132598094==--