From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/103619 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jeroen Newsgroups: gmane.comp.tex.context Subject: Question and Answer Iteration Date: Tue, 12 Mar 2019 17:16:33 +0000 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1022222761250936859==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="97600"; mail-complaints-to="usenet@blaine.gmane.org" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Mar 12 18:15:23 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1h3kzr-000PGE-2j for gctc-ntg-context-518@m.gmane.org; Tue, 12 Mar 2019 18:15:23 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 997D4FB60A; Tue, 12 Mar 2019 18:15:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vpUxlNR0H5uE; Tue, 12 Mar 2019 18:15:13 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AAB64FB5FF; Tue, 12 Mar 2019 18:15:13 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id EF5D4FB5FF for ; Tue, 12 Mar 2019 18:15:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AhrW9eZC9oKu for ; Tue, 12 Mar 2019 18:15:11 +0100 (CET) Original-Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 56B0CFB4EF for ; Tue, 12 Mar 2019 18:15:11 +0100 (CET) Original-Received: by mail-qk1-f177.google.com with SMTP id n6so1935758qkf.1 for ; Tue, 12 Mar 2019 10:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=PSed5s6gyhojPTdq2dAWPKwiPUGCUzMhAuAuE09rvmE=; b=vAP/nWsvq7CY/+nRfzwBwWsofhO/lhTLqRzF302tpOaZ6X5Ht8BfwZ+8iTRnYgTl6i OgeY0PUAgn/ACHQt8bbCkItrUxhRPtlSTynsG4cEU/Q06KwTb42hDYNrkhktbeJg+AEo VqzRNOWsaFCLTIRHw0r+64rLWvteLnj7E1jOfPZiafy76BBiRPYVoKjw0OPSv+G3XH/l HnzPWappLp3AH8cOg3YSJ4JIjwXQUZk1Jb/WITZm4hY8zp91HvJYSF4k9y9OJWugpkse euv+64ifXGcui5ThBQYum49CM7sPzRhrMXD8y2Uw+xZcNXdjV+fwdh/4JNS+oIJKvFZ8 iFKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PSed5s6gyhojPTdq2dAWPKwiPUGCUzMhAuAuE09rvmE=; b=AhtOUW7eiNpRBl+CA/wuxjRrP9whUhZuy/CPxE1WZweoYyCTcUpYIU+Nhvd04k4GpS NVxylFB4qt+iV/xJcdonFOKugNeqjOmGJevBkAulYbz14NsWsgfhdP8SwQSz3Rgzz6Zd 11jfe2pTroKpxVJ7892OlbSi54KhfcwnPqS0C1T5d+Y23hX016kKrWAyowV87zlVRy3R 7IYBgCI2sJwJdY1BNzP4GA1Gu+rU1MyyjXkvZ+fC0Q7nEbwZ3wZwTuZ/G37oW7lVAqdn mk7ohndUoSaB3xGTLQqaWCzVouJH9Oe2NHOwil24gtCAb6nGRZ/KGRWtgmsEhs5zQZNB /XHA== X-Gm-Message-State: APjAAAWDrQdFEI60OftVxsmmRIergAiZ/6Oi84ym126Q5BUReUjEwUeG JRbnD01fRPEod7UIWsB+oFe0/PMhMRRVyiXfK++TQv4x X-Google-Smtp-Source: APXvYqyJzB0j6KcbWBQHkaenGkAXAFbxgHBabO39+/DXNtn4MoR1l3rkwnbOo00t14NdKdGmYRkXMDi3fQfp3JwlQ3E= X-Received: by 2002:a37:ac12:: with SMTP id e18mr4902637qkm.195.1552410910131; Tue, 12 Mar 2019 10:15:10 -0700 (PDT) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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" Xref: news.gmane.org gmane.comp.tex.context:103619 Archived-At: --===============1022222761250936859== Content-Type: multipart/alternative; boundary="000000000000d80a510583e8d4fd" --000000000000d80a510583e8d4fd Content-Type: text/plain; charset="UTF-8" Dear list The configuration below is what I found for a question and answer section. If would like the text to start immediately after "question 1", "question2", etc. and not below it and the same for the answers. Is there an easy way to achieve this? Regards, Jeroen \setupinteraction[state=start] \define[1]\QuestionTextCommand {\doglobal\increment\QuestionCounter \pagereference[question:\QuestionCounter]% \doifreferencefoundelse{answer:\QuestionCounter} {\goto{#1}[answer:\QuestionCounter]} {#1}} \define[1]\AnswerTextCommand {\doglobal\increment\AnswerCounter \pagereference[answer:\AnswerCounter]% \doifreferencefoundelse{question:\AnswerCounter} {\goto{#1}[question:\AnswerCounter]} {#1}} \defineenumeration [question] [text=Question, headcommand=\QuestionTextCommand] \defineenumeration [answer] [text=Answer, headcommand=\AnswerTextCommand] \defineblock[answer] \startbuffer % \startquestion \input knuth \stopquestion % \beginanswer \startanswer \input knuth \stopanswer \endanswer % \stopbuffer \starttext \dorecurse{10}{\getbuffer} \page \useblocks[answer] \stoptext --000000000000d80a510583e8d4fd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear list

T= he configuration below is what I found for a question and answer section. I= f would like the text to start immediately after "question 1", &q= uot;question2", etc. and not below it and the same for the answers. Is= there an easy=C2=A0way to achieve this?

Regards, = Jeroen


\setupinteraction[state= =3Dstart]
=C2=A0
\define[1]\QuestionTextCommand
=C2=A0=C2=A0 {\dog= lobal\increment\QuestionCounter
=C2=A0=C2=A0=C2=A0 \pagereference[questi= on:\QuestionCounter]%
=C2=A0=C2=A0=C2=A0 \doifreferencefoundelse{answer:= \QuestionCounter}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {\goto{#1}[answer:\Ques= tionCounter]}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {#1}}
=C2=A0
\define[= 1]\AnswerTextCommand
=C2=A0=C2=A0 {\doglobal\increment\AnswerCounter
= =C2=A0=C2=A0=C2=A0 \pagereference[answer:\AnswerCounter]%
=C2=A0=C2=A0= =C2=A0 \doifreferencefoundelse{question:\AnswerCounter}
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 {\goto{#1}[question:\AnswerCounter]}
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 {#1}}
=C2=A0
\defineenumeration
=C2=A0=C2=A0 [questio= n]
=C2=A0=C2=A0 [text=3DQuestion,
=C2=A0=C2=A0=C2=A0 headcommand=3D\Q= uestionTextCommand]
=C2=A0
\defineenumeration
=C2=A0=C2=A0 [answer= ]
=C2=A0=C2=A0 [text=3DAnswer,
=C2=A0=C2=A0=C2=A0 headcommand=3D\Answ= erTextCommand]
=C2=A0
\defineblock[answer]
=C2=A0
\startbuffer<= br>=C2=A0=C2=A0=C2=A0=C2=A0 %
=C2=A0=C2=A0=C2=A0=C2=A0 \startquestion=C2=A0=C2=A0=C2=A0=C2=A0 \input knuth
=C2=A0=C2=A0=C2=A0=C2=A0 \stopque= stion
=C2=A0=C2=A0=C2=A0=C2=A0 %
=C2=A0=C2=A0=C2=A0=C2=A0 \beginanswe= r
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \startanswer
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \input knuth
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \stopanswer
=C2=A0=C2=A0=C2=A0=C2= =A0 \endanswer
=C2=A0=C2=A0=C2=A0=C2=A0 %
\stopbuffer
=C2=A0
\s= tarttext
\dorecurse{10}{\getbuffer}
=C2=A0
\page
=C2=A0<= br>\useblocks[answer]
=C2=A0
\stoptext
--000000000000d80a510583e8d4fd-- --===============1022222761250936859== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============1022222761250936859==--