[NTG-context] Clickable question/answer numbers

Wolfgang Schuster schuster.wolfgang at gmail.com
Sat Nov 5 19:14:27 CET 2016

> Otared Kavian <mailto:otared at gmail.com>
> 5. November 2016 um 18:34
> Hi Wolfgang, Hi Mikael,
> Thank you both for your great inputs!
> I tried to modify the code each of you sent yesterday in order to « 
> couple » automatically each question with its answer, using the 
> keyword « coupling=… », but somehow I am unable to create automatic 
> references by extracting the number of each question or that of each 
> answer, for example by using \rawcountervalue,
> or \currentconstructionnumber. Strangely the latter gives the name of 
> the construction and not a number: is it on purpose?
The \currentconstructionnumber command contains the name of the counter 
but getting the counter value won’t help because it comes too late.
> The solution Wolfgang proposes today, using the new keyword 
> referenceprefix, is almost perfect: however would it possible to 
> create a version of
> « currentconstructionreference » which creates a reference named for 
> instance
> answer:NumberOfCurentConstruction
The referenceprefix key is only usefull when you set the reference by hand.
> The reason for which I need such a construction is that in a document 
> with hundreds or more exercise —> hint —> solution, it would be handy 
> to avoid creating each time a manual reference, and then one would 
> navigate from a Question to its Hint and then  back to the Question or 
> go to its Answer.
When you always all three elements (question, hint and answer) you can 
a counter at the begin of each element and create a page reference which 
the value of the counter.

Below is a modified version of my previous example for this method.

%%%% begin example






     \input knuth
         \input knuth





%%%% end example

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20161105/18b02b50/attachment-0001.html>

More information about the ntg-context mailing list