From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85900 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: setuphead for in-paragraph head ? Date: Sun, 12 Jan 2014 22:40:20 +0100 Message-ID: <9F71771F-0932-4BFC-A444-646AFA0AE81C@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> <1CEEA7A0-3472-47A6-9AE9-C7D14CB379D4@gmail.com> <86D737E4-2891-4C79-BB04-CDCFA2BD9BB2@gmail.com> <2CFAA317-CA82-4CBF-A9B8-E71C2DC49BC1@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="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1389562824 31144 80.91.229.3 (12 Jan 2014 21:40:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jan 2014 21:40:24 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jan 12 22:40:32 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 1W2Slf-0007kq-IK for gctc-ntg-context-518@m.gmane.org; Sun, 12 Jan 2014 22:40:27 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BE8FC101E8; Sun, 12 Jan 2014 22:40:26 +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 r-mCuKxwYiiY; Sun, 12 Jan 2014 22:40:25 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 7FE4A101E2; Sun, 12 Jan 2014 22:40:25 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9164C101E2 for ; Sun, 12 Jan 2014 22:40:24 +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 2hU6Jcu32JNH for ; Sun, 12 Jan 2014 22:40:23 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id C7E99101DE for ; Sun, 12 Jan 2014 22:40:23 +0100 (CET) Original-Received: from mail-bk0-x22d.google.com (mail-bk0-x22d.google.com [IPv6:2a00:1450:4008:c01::22d]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s0CLqDW5003870 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sun, 12 Jan 2014 22:52:13 +0100 Original-Received: by mail-bk0-f45.google.com with SMTP id v16so380357bkz.4 for ; Sun, 12 Jan 2014 13:40:22 -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=431wy36cBeglPewM9/oP1escneqCT5cUJU4HAOHobC4=; b=t/wSZ1d7RH8wtLLij/uDI7PL/VTPDAkCYdtkGkFt03wYh4vuYlydTRgTgqueIX47Nb d6IvwEoIgvpXElbfj4l0g3Wwqu+Hc9UIK6iFkE+GriTBnjDmJRkn91pGraC5Z7PP9hEa 75kKvh3Q0nkEYY6PEiWISBoBVahb1XpNExb8aNLoHYS/UMIuybDCFWMWQolt+0avJB02 +EpcXBNlUUruOj69SMgkMdTNX7JRHy/562tWbl6uE+u8orIRqIWfzmMOKZRCmnI/OJgY A2dTqdk74w3HCaZto0hKQr024EC+SzvjjMMoa+F1+owgNP85ajMXy07qfou8auaZCeIF uxQg== X-Received: by 10.204.167.81 with SMTP id p17mr52818bky.59.1389562822811; Sun, 12 Jan 2014 13:40:22 -0800 (PST) Original-Received: from keima.localdomain (x2f24adb.dyn.telefonica.de. [2.242.74.219]) by mx.google.com with ESMTPSA id q5sm13952427bkr.5.2014.01.12.13.40.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 12 Jan 2014 13:40:22 -0800 (PST) In-Reply-To: <2CFAA317-CA82-4CBF-A9B8-E71C2DC49BC1@gmail.com> X-Mailer: Apple Mail (2.1827) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:4008:c01::22d; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01Ld9QdWz - 9866061f9771 - 20140112 (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:85900 Archived-At: Am 12.01.2014 um 21:47 schrieb Otared Kavian : > > On 12 janv. 2014, at 21:30, Wolfgang Schuster wrote: > >> >> Am 11.01.2014 um 20:01 schrieb Otared Kavian : >> >>> I will put this example on the wiki, but before doing so I have another question: >>> 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 question? 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 other links to each answer going to its hint and question. One can do this manually by adding a reference to each question, each hint and each answer, but it would be nice to have this done automatically. >> >> Not without writing your own environment where you generate a unique reference for each question, hint and answer. > > If I understand well, one way might be something like (where \theQuestionNumber stands for the number given by \startquestion) > > \define\StartQuestion{\startquestion[Q:\theQuestionNumber]} > \define\StartHint{\startquestion[H:\theQuestionNumber]} > \define\StartAnswer{\startquestion[A:\theQuestionNumber]} > \define\StopQuestion{\par\in{Hint}[H:\theQuestionNumber]\par \in{Answer}[A:\theQuestionNumber]\stopquestion} > \define\StopHint{\par\in{Question}[Q:\theQuestionNumber]\par \in{Answer}[A:\theQuestionNumber]\stophint} > \define\StopAnswer{\par\in{Question}[Q:\theQuestionNumber]\par \in{Hint}[H:\theQuestionNumber]\stopquestion} > > and then using \StartQuestion \StopQuestion, etc, instead of \startquestion \stopquestion. > But how can I refer to the \theQuestionNumber set by \startquestion? When you have only questions and answers you can use the coupling key but in your case something like below is necessary: \defineenumeration[Question] \defineenumeration[Answer] \define\startquestion {\increment\QuestionCounter \expanded{\startQuestion[reference=Question:\QuestionCounter]}} \define\stopquestion {\stopQuestion \par \in{Answer}[Answer:\QuestionCounter]} \define\startanswer {\expanded{\startAnswer[reference=Answer:\QuestionCounter]}} \define\stopanswer {\stopAnswer \par \in{Question}[Question:\QuestionCounter]} \setupinteraction[state=start] \starttext \startquestion What is the answer to life the universe and everything? \stopquestion \page \startanswer 42. \stopanswer \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-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________