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: qa.pdf
Description: Adobe PDF document

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to