From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73616 Path: news.gmane.org!not-for-mail From: Rene van Hassel Newsgroups: gmane.comp.tex.context Subject: howto get good references in mkiv? Date: Thu, 5 Jan 2012 15:04:08 +0100 Message-ID: <20120105150409.BUH4U.32041.root@viefep11> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1325772286 7580 80.91.229.12 (5 Jan 2012 14:04:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2012 14:04:46 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 05 15:04:41 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rinvq-0001FF-QW for gctc-ntg-context-518@m.gmane.org; Thu, 05 Jan 2012 15:04:38 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3C38FCB1CE; Thu, 5 Jan 2012 15:04:36 +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 SDp7ggCATjxm; Thu, 5 Jan 2012 15:04:27 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E6654CB1B4; Thu, 5 Jan 2012 15:04:26 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 41B70CB1B4 for ; Thu, 5 Jan 2012 15:04:25 +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 8LTPqeNMBGGj for ; Thu, 5 Jan 2012 15:04:10 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 4D784CB1B3 for ; Thu, 5 Jan 2012 15:04:10 +0100 (CET) Original-Received: from fep17.mx.upcmail.net (fep17.mx.upcmail.net [62.179.121.37]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q05E49X0016614 for ; Thu, 5 Jan 2012 15:04:09 +0100 Original-Received: from edge04.upcmail.net ([192.168.13.239]) by viefep17-int.chello.at (InterMail vM.8.01.05.04 201-2260-151-105-20111014) with ESMTP id <20120105140409.PVHV23826.viefep17-int.chello.at@edge04.upcmail.net> for ; Thu, 5 Jan 2012 15:04:09 +0100 Original-Received: from viefep11 ([192.168.14.250]) by edge04.upcmail.net with edge id Hq481i02E5PiXJQ04q48p9; Thu, 05 Jan 2012 15:04:09 +0100 X-SourceIP: 192.168.14.250 X-Priority: 3 (Normal) Sensitivity: Normal X-Originating-IP: from 131.155.70.8 by Tunnel_15; Thu, 5 Jan 2012 15:04:08 +0100 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=62.179.121.37; country=AT; latitude=47.3333; longitude=13.3333; http://maps.google.com/maps?q=47.3333,13.3333&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rGhO49TT - 6e4e616a1bc4 - 20120105 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:73616 Archived-At: Hello Members, some piece of code, with the problems. I hope somebody can use it to improve ConTeXt, Compilation with texexec is no problem, Kind Regards, Rene' % Begin code: \setupcolors[state=start] \setupinteraction[state=start,color=orange] \setupreferencing[state=start] \defineblock[question] \defineblock[answer] \defineenumeration[question][location=top,coupling=answer] \defineenumeration[answer][location=top,coupling=question] \hideblocks[question] \hideblocks[answer] \defineblock[exercise] \defineblock[solution] \defineenumeration[exercise][location=top,text=Exercise] \defineenumeration[solution][location=top,text=Solution] \hideblocks[exercise] \hideblocks[solution] \defineblock[exer] \defineblock[sol] \defineenumeration[exer][location=top,text=Exercise] \defineenumeration[sol][location=top,text=Solution] \hideblocks[exer] \hideblocks[sol] \starttext \chapter{Preface} To write Lecture Notes or Exams I want to use a mechanism such that in just one paper the questions and the answers can be written. And then to hide the answers at some way or to get a coupling between the exercises and the solutions.\crlf I wanted also a mechanism to give each exercise and each solution a number. These numbers have not to be equal. It is may be better for the students that numbers of the solutions are different from that of the exercises! Than they can play the game: "What exercise belongs to a certain solution?"\crlf The Zeroth Attempt: a try to use "coupling".\crlf The First Attempt: the use of blocks, but the coupling explicit made by myself and there is made use of \type{\defineenumeration}.\crlf The Second Attempt: this I used already succesfully by texexec. I defined by myself a new counter and used that counter in \type{\itemize} and I referenced to the \type{\item}(s).\crlf\crlf Used is the frozen texexec "version 6.2.1 - 1997-2009 - PRAGMA ADE/POD" and "version 2011.05.18 18:04", resp. "version 2012.01.02 21:59" of context. \crlf On the way I learned howto work with a standalone ConTeXt and a system-wide installed ConTeXt. \chapter{Different mechanism to number exercises and solutions} \subsection{Zeroth Attempt} % Begin: Zeroth Attempt This Zeroth Attempt is a tryout to see if the coupling mechanism works. I never used it before so I was curiuous. \crlf\crlf If all the examples are done at once:\crlf Compilation stopped at the places: First Question, Second Question, First Answer and Second Answer. Pushed Enter and compilation continued. \startitemize[n] % oke \item With texexec: no coupling. You don't see anything. % oke \item With context ( version: 2012.01.02 21:59): You see some text written in orange "somewhere", but no interactivity.\crlf Compilation stopped at the places: First Question, Second Question, First Answer and Second Answer. Pushed Enter and compilation continued. % oke \item With context ( version: 2011.05.18 18:04): \crlf You see orange triangles as references, both the Exercises and the Solutions, but there is no interaction. \stopitemize If the example is done separately: \startitemize[n] % oke \item With texexec: no coupling. You don't see anything. % oke \item With context ( version: 2012.01.02 21:59): \crlf You see some text written in orange "somewhere", but no interactivity.\crlf Compilation stopped at the places: First Question, Second Question, First Answer and Second Answer. Pushed Enter and compilation continued. % oke \item With context ( version: 2011.05.18 18:04): \crlf You see orange triangles as references, both the Exercises and the Solutions, but there is no interaction. \crlf Compilation stopped at the places: First Question, Second Question, First Answer and Second Answer. Pushed Enter and compilation continued. \stopitemize \page \beginquestion \startquestion First Question \stopquestion \startquestion Second Question \stopquestion \endquestion \useblocks[question] \page \beginanswer \startanswer First Answer \stopanswer \startanswer Answer \stopanswer \endanswer \useblocks[answer] % End: Zeroth Attempt \subsection{First Attempt} % Begin: First Attempt Nested hidden blocks give problems, such as the continuation of the enumerations and also the amount of times that something is repeated. \crlf If all the examples are done at once:\crlf Compilation stopped at the places: First Question, Second Question, First Answer and Second Answer. Pushed Enter and compilation continued. \startitemize[n] % oke \item With texexec: no problems. % oke \item With context ( version: 2012.01.02 21:59): no references at all, so "??", both the Exercises and the Solutions. % oke \item With context ( version: 2011.05.18 18:04): \crlf no references at all, so "??", both the Exercises and the Solutions. \stopitemize If the example is done separately: \startitemize[n] % oke \item With texexec: no problems. % oke \item With context ( current version: 2012.01.02 21:59): The references do what they have to do. No problems. % oke \item With context ( current version: 2011.05.18 18:04): The references do what they have to do. No problems. \stopitemize \beginexercise \startexercise[exer-1] First exercise.\crlf See \in{Solution}[sol-1]. \stopexercise \startexercise[exer-2] Second exercise.\crlf See \in{Solution}[sol-2]. \stopexercise \endexercise \beginsolution \startsolution[sol-1] First solution!\crlf See \in{Exercise}[exer-1]. \stopsolution \startsolution[sol-2] Second solution!\crlf See \in{Exercise}[exer-2]. \stopsolution \endsolution \useblocks[exercise] \page \useblocks[solution] \page % End: First Attempt \subsection{Second Attempt} % Begin: Second Attempt If all the examples are done at once:\crlf Compilation stopped at the places: First Question, Second Question, First Answer and Second Answer. Pushed Enter and compilation continued. \startitemize[n] % oke \item With texexec no problems. % oke \item With context ( version: 2012.01.02 21:59): there are references, written in orange, but to the wrong places. % oke \item With context ( version: 2011.05.18 18:04): \crlf there are references, written in orange, but to the wrong places. \stopitemize If the example is done separately:\crlf \startitemize[n] % oke \item With texexec no problems. % oke \item With context ( version: 2012.01.02 21:59): there are references, written in orange, but they don't work, so no interactivity\crlf % oke \item With context ( version: 2011.05.18 18:04): \crlf there are references, written in orange, but they don't work, so no interaction.\crlf \stopitemize \def\nextnumber#1{\the\numexpr#1\relax} \defineconversion[nee][\nextnumber] \setupitemize[broad,packed] \startitemize[nee][left={Ex-},stopper={: },width=1.5cm] % nee: new exam exercise % Exercise \item[221106-Ex-4] Question 221106-Ex-4.\crlf Solution, see \in{Sol-}[221106-Ex-4-sol].\crlf % Exercise \item[221106-Ex-5] Question 221106-Ex-5.\crlf Solution, see \in{Sol-}[221106-Ex-5-sol].\crlf % End list of Exercises: \stopitemize \page % Start list of solutions: %=0 % nsee (new solution exam exercises) \def\nextnumber#1{\the\numexpr#1\relax} \defineconversion[nsee][\nextnumber] \setupitemize[broad,packed] \startitemize[nsee][left={Sol-},stopper={: },width=1.5cm] % Solution \item[221106-Ex-4-sol] Solution 221106-Ex-4.\crlf See Exercise \in{Ex-}[221106-Ex-4]\crlf % Solution \item[221106-Ex-5-sol] Solution 221106-Ex-5.\crlf See Exercise \in{Ex-}[221106-Ex-5]\crlf % End list of solutions \stopitemize \crlf At \at{page}[221106-Ex-4].\crlf At \at{page}[exer-2]. % End: Second Attempt \chapter{Summary} My hope is that somebody can use these results to improve ConTeXt. \crlf If the examples are compiled separately than the results are different from that as the examples are compiled together at once! \crlf Yesterday sitting at home and outside it rained, I got also difficulties with TikZ, something with \type{catcode....}? But I have first to search for a little example before I send something to the mail-archive. \stoptext % End code. ___________________________________________________________________________________ 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 ___________________________________________________________________________________