ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Clickable question/answer numbers
@ 2016-11-02 11:43 Mikael P. Sundqvist
  2016-11-02 12:52 ` Otared Kavian
  0 siblings, 1 reply; 20+ messages in thread
From: Mikael P. Sundqvist @ 2016-11-02 11:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1479 bytes --]

Dear list,

I have a pretty large text with a lot of questions and answers, and
want the user(students) to be able to click in the pdf to go from a
certain exercise to its answer, and back. I have a solution (see
below) to go from answers to questions, but not the other way around.
I simply have no idea on how to make the red text (in the head) in the
example question clickable with the answer on the next page as target.
As you can see, the answer has a tag A:Q:test (I want to set these
automatically in that manner), and clicking the green text I get to
the correct place. I just don't see how to make the "Question 1.1"
clickable with that target.

I hope I make myself clear. If it matters, in the solution one could
assume that the optional tag of the \startquestion \stopquestion is
given for all questions.

Best regards, Mikael

%% qa.tex
\setupinteraction[state=start,color=,contrastcolor=,style=]

\defineblock[answer]
\hideblocks[answer]

\def\myanswer[#1]{\inleft{\in[#1]\reference[A:#1]{\in[#1]}}}

\defineenumeration[question][
text=Question,
headcolor=darkred,
width=fit,
number=yes,
prefix=yes,
prefixsegments=section,
]

\starttext

\section{A section with questions}

\startquestion[Q:test]
Solve this question!
\stopquestion

We could, however, click \color[darkyellow]{\in{Answer}[A:Q:test]}.

\beginanswer
\myanswer[Q:test]
What question? The answer is \quotation{do it yourself}!
\endanswer

\page[yes]

\subject{Answers}

\useblocks[answer]

\stoptext

[-- Attachment #2: qa.pdf --]
[-- Type: application/pdf, Size: 13435 bytes --]

[-- Attachment #3: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 20+ messages in thread
[parent not found: <mailman.245.1478488929.2018.ntg-context@ntg.nl>]

end of thread, other threads:[~2016-11-07 12:46 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-02 11:43 Clickable question/answer numbers Mikael P. Sundqvist
2016-11-02 12:52 ` Otared Kavian
2016-11-02 15:16   ` Mikael P. Sundqvist
2016-11-02 20:04     ` Otared Kavian
2016-11-02 20:58       ` Mikael P. Sundqvist
2016-11-03  9:34         ` Hans Hagen
2016-11-03 11:58           ` Mikael P. Sundqvist
2016-11-03 15:14             ` Mikael P. Sundqvist
2016-11-04  8:10               ` Otared Kavian
2016-11-04 11:50               ` Wolfgang Schuster
2016-11-04 15:33                 ` Mikael P. Sundqvist
2016-11-05 12:38                   ` Wolfgang Schuster
2016-11-05 12:43                     ` Mikael P. Sundqvist
2016-11-05 17:34                     ` Otared Kavian
2016-11-05 18:14                       ` Wolfgang Schuster
2016-11-06 10:43                         ` Otared Kavian
2016-11-06 11:55                           ` Wolfgang Schuster
2016-11-06 14:46                             ` Otared Kavian
     [not found] <mailman.245.1478488929.2018.ntg-context@ntg.nl>
2016-11-07 12:19 ` Jeong Dal
2016-11-07 12:46   ` Otared Kavian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).