4.
November 2016 um 16:33
With the new beta you can set a default prefix for enumeration
references,
i.e. you can write \startquestion[knuth] in your document without the
need
to add a question or answer prefix.
\setupinteraction[state=start]
\define[1]\QuestionTextCommand
{\doifreferencefoundelse{answer:\currentconstructionreference}
{\goto{#1}[answer:\currentconstructionreference]}
{#1}}
\define[1]\AnswerTextCommand
{\doifreferencefoundelse{question:\currentconstructionreference}
{\goto{#1}[question:\currentconstructionreference]}
{#1}}
\defineenumeration
[question]
[text=Question,
headcommand=\QuestionTextCommand,
referenceprefix=question]
\defineenumeration
[answer]
[text=Answer,
headcommand=\AnswerTextCommand,
referenceprefix=answer]
\starttext
\startquestion[knuth]
\input knuth
\stopquestion
\page
\startanswer[knuth]
\input knuth
\stopanswer
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
___________________________________________________________________________________