From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/96754 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Clickable question/answer numbers Date: Fri, 04 Nov 2016 12:50:40 +0100 Message-ID: <581C7610.9060501@gmail.com> References: <72F9D2F7-1726-42EF-B764-32A8168D3AC4@gmail.com> <75102198-e5ea-c9b7-1979-a5e3d6c6c042@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2185515274135988534==" X-Trace: blaine.gmane.org 1478260326 15453 195.159.176.226 (4 Nov 2016 11:52:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 4 Nov 2016 11:52:06 +0000 (UTC) User-Agent: Postbox 5.0.5 (Macintosh/20161020) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 04 12:52:01 2016 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 esmtp (Exim 4.84_2) (envelope-from ) id 1c2d1h-0007vI-79 for gctc-ntg-context-518@m.gmane.org; Fri, 04 Nov 2016 12:51:17 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B11E31D00A; Fri, 4 Nov 2016 12:50:57 +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 nhS9gyqV9QjG; Fri, 4 Nov 2016 12:50:56 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 732551D00C; Fri, 4 Nov 2016 12:50:56 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 855E81D009 for ; Fri, 4 Nov 2016 12:50:55 +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 coJi2q-GT6H9 for ; Fri, 4 Nov 2016 12:50:54 +0100 (CET) Original-Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (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 776E11D008 for ; Fri, 4 Nov 2016 12:50:44 +0100 (CET) Original-Received: by mail-wm0-f47.google.com with SMTP id a197so45674303wmd.0 for ; Fri, 04 Nov 2016 04:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=JJ4OluI7RVK+8ImlHLTdy4qu5Bsi3NLda2h91ZOXHr4=; b=azBWoZHcPg4OVmVJcu35r8hW47jzx/2qjfidnKypRkdvFon9cksURDkLKrQiYsKB6X AdyfkOsduyItMmp71IsJ+B7Pk71FB7MZmtB++Qf8jgh34qOSCJdFQuBatWg9nTsyHmKd JcqMyiDKCPgCJEvqs+zn/d796kQdQfIa+BMtxkUqGGLxSpbt0DujaRmQt2xdCPRgfNHn DeFR0mPsZciEQDNZO3yqPnCIjnOulRBG1nRH73zZ26qTNAJAx/D28jz+PGk2R+Yk1LRz BJqfRAT6YPKaaQJdgGQ8Cz1JylqJ+Zvy2fVdCGIfColuX6CXB4heBAfiSu3d/GAtml5G 3tFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=JJ4OluI7RVK+8ImlHLTdy4qu5Bsi3NLda2h91ZOXHr4=; b=AhSGKeDUII+qnjqKdUplHe8ufXwPQyiD4cDxEbY560u3RDf5BWGZHdGGHWH9JRHPT1 v25GPi+gcrVep35O7tasiNI0ETwKTlgaqGGxeNv9HQfG8yMwDUOa8d1VT+BAYv2nUU/f riYT4iHox/z88AF2bD8DXqjq2g3ZNXxQ3b07sdIUCfr9Ea//kLM1yz2CLSox3u7WRXOs xL1bFylswogHqBVfzzdbJ2ekvwQWEZl+o9bKdgeq6m0umc+Io1qdiLjFJicjI2/zx/6+ fH4gS15luclPYJi03/1mhW1ymRrcgByMF4T0NJz96Bgp+fWr6rV8431Y+4+H3qxP2CDR fcOg== X-Gm-Message-State: ABUngvegFSuuvAZjyd3iPYXkB0Jxtkkzvs7WGWCXTUAOBB3NWmRUK0CU+WjLt4QXUve+Mw== X-Received: by 10.194.6.36 with SMTP id x4mr13764806wjx.175.1478260243838; Fri, 04 Nov 2016 04:50:43 -0700 (PDT) Original-Received: from keima.localdomain (x2f258b8.dyn.telefonica.de. [2.242.88.184]) by smtp.gmail.com with ESMTPSA id im3sm13875478wjb.13.2016.11.04.04.50.42 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Nov 2016 04:50:43 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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:96754 Archived-At: This is a multi-part message in MIME format. --===============2185515274135988534== Content-Type: multipart/alternative; boundary="------------070508050604020606030009" This is a multi-part message in MIME format. --------------070508050604020606030009 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > Mikael P. Sundqvist > 3. November 2016 um 16:14 > Dear Otared (and others), > > while waiting for Hans reply on the \namedenumerationparameter and > \enumerationparameter, this is the best I could do. Now, only > "Question" is clickable and not the number, but I think I could live > with that if no other solution show up. The reference value is set in a group and can only be accessed within this group but you can use \currentconstructionreference to access it. \setupinteraction[state=start] \define[1]\QuestionTextCommand {\doifreferencefoundelse{answer:\cldcontext{lpeg.match(lpeg.secondofsplit(":"),"\currentconstructionreference")}} {\goto{#1}[answer:\cldcontext{lpeg.match(lpeg.secondofsplit(":"),"\currentconstructionreference")}]} {#1}} \define[1]\AnswerTextCommand {\doifreferencefoundelse{question:\cldcontext{lpeg.match(lpeg.secondofsplit(":"),"\currentconstructionreference")}} {\goto{#1}[question:\cldcontext{lpeg.match(lpeg.secondofsplit(":"),"\currentconstructionreference")}]} {#1}} \defineenumeration [question] [text=Question,headcommand=\QuestionTextCommand] \defineenumeration [answer] [text=Answer,headcommand=\AnswerTextCommand] \starttext \startquestion[question:knuth] \input knuth \stopquestion \page \startanswer[answer:knuth] \input knuth \stopanswer \stoptext Wolfgang --------------070508050604020606030009 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
3. November 2016 um 16:14
Dear Otared (and others),

while waiting for Hans reply on the \namedenumerationparameter and
\enumerationparameter, this is the best I could do. Now, only
"Question" is clickable and not the number, but I think I could live
with that if no other solution show up.
The reference value is set in a group and can only be accessed within this group
but you can use \currentconstructionreference to access it.

\setupinteraction[state=start]

\define[1]\QuestionTextCommand
  {\doifreferencefoundelse{answer:\cldcontext{lpeg.match(lpeg.secondofsplit(":"),"\currentconstructionreference")}}
     {\goto{#1}[answer:\cldcontext{lpeg.match(lpeg.secondofsplit(":"),"\currentconstructionreference")}]}
     {#1}}

\define[1]\AnswerTextCommand
  {\doifreferencefoundelse{question:\cldcontext{lpeg.match(lpeg.secondofsplit(":"),"\currentconstructionreference")}}
     {\goto{#1}[question:\cldcontext{lpeg.match(lpeg.secondofsplit(":"),"\currentconstructionreference")}]}
     {#1}}

\defineenumeration [question] [text=Question,headcommand=\QuestionTextCommand]
\defineenumeration [answer]   [text=Answer,headcommand=\AnswerTextCommand]

\starttext

\startquestion[question:knuth]
\input knuth
\stopquestion

\page

\startanswer[answer:knuth]
\input knuth
\stopanswer

\stoptext

Wolfgang
--------------070508050604020606030009-- --===============2185515274135988534== 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 X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============2185515274135988534==--