[NTG-context] Creeps (binding gutter / margin correction in imposition)

2016-11-06 Thread Henning Hraban Ramm
Hi together,

this is not really a practical request, but an interesting (I think) idea...

ConTeXt can do simple imposition (arranging pages on sheets, see 
\setuparranging), but in professional imposition you need to compensate for the 
paper thickness in folds to keep pages readable - you can move the outer pages 
of a fold out of the gutter (spine), or move the inner pages to the spine. 
(This is called creep in English, Bundversatz in German.) That means, your 
outer margin will have different width, depending on the position of the page 
in its fold.

See e.g. https://helpx.adobe.com/indesign/using/printing-booklets.html

A guy on the LilyPond mailing list had the interesting idea to adapt the line 
width to this creep, to keep an even outer margin - it would mean that TeX 
needs to know about imposition while breaking lines.

What do you think?


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

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

Re: [NTG-context] Clickable question/answer numbers (Otared Kavian)

2016-11-06 Thread Otared Kavian
Dear Dalyoung,

I guess you are typesetting the wrong file, or you have put the last code I 
sent into a file which contains something of the previous codes…
Indeed in the last file I sent (which I am sending again at the end of this 
reply) does not contain the command \myanswer… which appears in your error 
message.

Please test the code below and let me know if you encunter a problem.

Best regards: OK
 begin interactive-question-answer.tex
 Here, following Wolfgang Schuster's ideas, 
 we define some macros allowing to couple
 Questions and Answers in an automatic way
 Upon clicking on an interactive title for Question or Answer
 one goes to the corresponding Answer or Question

\setupinteraction[state=start]

% We define two counters which follow the numbers
% appearing in Question and Answer

\newcounter\QuestionCounter
\newcounter\AnswerCounter

% We create two commands to be used in the
% enumeration environments
% Note that the check for trial typestting 
% \doifnotmode{*trialtypesetting}
% is necessary in order to avoid unwanted incrementation
\define[1]\QuestionTextCommand
  {\doifnotmode{*trialtypesetting}
 {\doglobal\increment\QuestionCounter
  \pagereference[question:\QuestionCounter]}%
   \doifreferencefoundelse{answer:\QuestionCounter}
 {\goto{#1}[answer:\QuestionCounter]}
 {#1}}

\define[1]\AnswerTextCommand
  {\doifnotmode{*trialtypesetting}
 {\doglobal\increment\AnswerCounter
  \pagereference[answer:\AnswerCounter]}%
   \doifreferencefoundelse{question:\AnswerCounter}
 {\goto{#1}[question:\AnswerCounter]}
 {#1}}

% We define here two enumeration environments for
% Questions and Answers
\defineenumeration[question]
[text=Question,
headcommand=\QuestionTextCommand,
number=yes,
prefix=yes,
prefixsegments=chapter,
coupling=answer]

\defineenumeration[answer]
[text=Answer,
headcommand=\AnswerTextCommand,
number=yes,
prefix=yes,
prefixsegments=chapter,
coupling=question]

% Each question is followed immediately by its answer.
% The answers are put in a block which will be used later
\defineblock[answer]
\hideblocks[answer]

% We define a command used after a  
% Question for which no Answer is provided
% Since the block commands 
% \beginanswer ... \endanswer
% cannot be used directly in a macro definition
% we use a trick...
% In the buffer the two counters associated to Answer
% are incremented...
\startbuffer[noanswer]
\beginanswer
\doglobal\increment\AnswerCounter
\incrementcounter[answer]
\endanswer
\stopbuffer

% ...and then the above buffer is invoked
\define\noanswer
  {\getbuffer[noanswer]}

% example of use:
\starttext
\startchapter[title=Questions]

\startquestion[q:1]
Prove that ${\rm e}\sim 2.73$ is irrational.

This is the first question, with its own reference, for later use.
\stopquestion

\beginanswer
\startanswer
This is the answer to the first question (to \in{Question}[q:1]).
\stopanswer
\endanswer

\startquestion 
This is the second question, without its own reference.
\stopquestion

\beginanswer
\startanswer[a:Test]
This is the answer to the second question. 

(Note that this answer has a reference named \type{a:Test}).
\stopanswer
\endanswer

\startquestion[q:Obvious]
This is the third question, an easy one, without a given solution.
\stopquestion

% we increment here the counters for Answer
\noanswer

\startquestion[q:2]
This is the fourth question with its own reference.
\stopquestion

\beginanswer
\startanswer
This is the answer to the fourth question: use the result of \in{Question}[q:1].
\stopanswer
\endanswer

\startquestion 
This is the fifth question, without its own reference. 

({\it Hint:} look again at \in{Question}[q:Obvious]).
\stopquestion

\beginanswer
\startanswer
This is the answer to the fifth question. Read again \in{Answer}[a:Test].
\stopanswer
\endanswer  

\stopchapter

% Here we say ownnumber=1, in order to match the prefix 
% of numbers associated to Answer
\startchapter[ownnumber=1,title=Answers and solutions]
\useblocks[answer]
\stopchapter

\stoptext
 end interactive-question-answer.tex




> On 6 Nov 2016, at 23:43, Jeong Dal  wrote:
> 
> Dear Otared,
> 
> Hi,
> I run the given  code and got an error message as following.
> 
> tex error   > tex error on line 1 in file virtual://block.answer.2: 
>  ! Undefined control sequence
> 
> l.1 \myanswer
>[Q:test]
> 
> 
> 
> Would you please tell me how to avoid such an error?
> It seems to me that you don’t have an error.
> 
> I am running minimal(beta) in OSX.
> 
> Thank you.
> 
> Best regards,
> 
> Dalyoung
> ___
> 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  : 

Re: [NTG-context] Clickable question/answer numbers (Otared Kavian)

2016-11-06 Thread Jeong Dal
Dear Otared,

Hi,
I run the given  code and got an error message as following.

tex error   > tex error on line 1 in file virtual://block.answer.2: ! 
Undefined control sequence

l.1 \myanswer
   [Q:test]



Would you please tell me how to avoid such an error?
It seems to me that you don’t have an error.

I am running minimal(beta) in OSX.

Thank you.

Best regards,

Dalyoung___
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
___

[NTG-context] Error while trying to generate font database

2016-11-06 Thread Sergey
Hi all,

I've updated today my version of context (rsync route, following
information on contextgarden). After performing the update I wanted to
generate the font database following instructions on
http://wiki.contextgarden.net/Fonts_in_LuaTeX. The following error emerged:

...ext/tex/texmf-context/tex/context/base/mkiv/font-otr.lua:102: attempt
to index local 'streamreader' (a nil value)

I run FreeBSD 11-CURRENT.

Any clues as to what might cause the error message?

Regards,
Sergey

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

Re: [NTG-context] Extract only certain part of document (via modes)?

2016-11-06 Thread Mikael P. Sundqvist
On Sun, Nov 6, 2016 at 3:03 PM, Wolfgang Schuster
 wrote:
> Mikael P. Sundqvist
> 6. November 2016 um 12:51
> Dear list, and in particular Hans,
>
> I asked the same question on stackexchange before today
> (http://tex.stackexchange.com/q/337738/52406), and got the answer that
> what I want to do might not be possible.
>
> In my large document I have exercises (typeset with \startexercise
> \stopexercise, defined as an enumeration). Is it possible to use modes
> (or any other trick) to be able to compile the same file and get only
> the exercises. For example,
>
> context file.tex
>
> should give the full document, while
>
> context --mode=exercises file.tex
>
> should give only all the exercises (or just everything "in one mode")?
>
> You can put each exercise in a block and ask Hans to add a \saveblocks
> commands
> which writes the content of all exercise blocks to a external file (like
> \savebuffer lets
> you save the content of a buffer in a external file).
>
>
> \defineblock[exercise]
> \keepblocks [exercise]
>
> \defineenumeration[exercise][text=Exercise]
>
> %\doifmode{exercises}{\saveblocks[exercise][exercises.tex]}
>
> \starttext
>
> \beginexercise
> \startexercise
> This is the first exercise.
> \stopexercise
> \endexercise
>
> \beginexercise
> \startexercise
> This is the second exercise.
> \stopexercise
> \endexercise
>
> \stoptext
>
>
> The content of this saved file can then be read by another file
> to get a document which contains only the exercises.
>
>
> \defineenumeration[exercise][text=Exercise]
>
> \starttext
>
> \doiffileelse{exercise}
>   {\input{exercises}}
>   {{\tttf Exercise file doesn’t exist.}}
>
> \stoptext
>
>
> Wolfgang
>
> ___
> 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
> ___

Thank you for the answer, I think that would be nice to have. Hans, do
you mind adding such a feature? Or do you have any other idea on the
problem as is?

/Mikael
___
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
___

Re: [NTG-context] Clickable question/answer numbers

2016-11-06 Thread Otared Kavian
Hi Wolfgang, Hi Mikael,

Thanks Wolfgang! I didn’t know that \beginBLOCKNAME \endBLOCKNAME cannot be 
used in other macros… There is some mystery in this for me.

Now with 
\doifnotmode{*trialtypesetting}
everything works as expected. 

Since I don’t know whether, nor where on the wiki, this can be wikified, for 
the archives and for other possible users, I copy below the entire example 
which allows to have interactive Questions and Answers. One can also easily add 
a chapter for Hints, if necessary.

Best regrads: OK

 begin interactive-question-answer.tex
 Here, following Wolfgang Schuster's ideas, 
 we define some macros allowing to couple
 Questions and Answers in an automatic way
 Upon clicking on an interactive title for Question or Answer
 one goes to the corresponding Answer or Question

\setupinteraction[state=start]

% We define two counters which follow the numbers
% appearing in Question and Answer

\newcounter\QuestionCounter
\newcounter\AnswerCounter

% We create two commands to be used in the
% enumeration environments
% Note that the check for trial typestting 
% \doifnotmode{*trialtypesetting}
% is necessary in order to avoid unwanted incrementation
\define[1]\QuestionTextCommand
  {\doifnotmode{*trialtypesetting}
 {\doglobal\increment\QuestionCounter
  \pagereference[question:\QuestionCounter]}%
   \doifreferencefoundelse{answer:\QuestionCounter}
 {\goto{#1}[answer:\QuestionCounter]}
 {#1}}

\define[1]\AnswerTextCommand
  {\doifnotmode{*trialtypesetting}
 {\doglobal\increment\AnswerCounter
  \pagereference[answer:\AnswerCounter]}%
   \doifreferencefoundelse{question:\AnswerCounter}
 {\goto{#1}[question:\AnswerCounter]}
 {#1}}

% We define here two enumeration environments for
% Questions and Answers
\defineenumeration[question]
[text=Question,
headcommand=\QuestionTextCommand,
number=yes,
prefix=yes,
prefixsegments=chapter,
coupling=answer]

\defineenumeration[answer]
[text=Answer,
headcommand=\AnswerTextCommand,
number=yes,
prefix=yes,
prefixsegments=chapter,
coupling=question]

% Each question is followed immediately by its answer.
% The answers are put in a block which will be used later
\defineblock[answer]
\hideblocks[answer]

% We define a command used after a  
% Question for which no Answer is provided
% Since the block commands 
% \beginanswer ... \endanswer
% cannot be used directly in a macro definition
% we use a trick...
% In the buffer the two counters associated to Answer
% are incremented...
\startbuffer[noanswer]
\beginanswer
\doglobal\increment\AnswerCounter
\incrementcounter[answer]
\endanswer
\stopbuffer

% ...and then the above buffer is invoked
\define\noanswer
  {\getbuffer[noanswer]}

% example of use:
\starttext
\startchapter[title=Questions]

\startquestion[q:1]
Prove that ${\rm e}\sim 2.73$ is irrational.

This is the first question, with its own reference, for later use.
\stopquestion

\beginanswer
\startanswer
This is the answer to the first question (to \in{Question}[q:1]).
\stopanswer
\endanswer

\startquestion 
This is the second question, without its own reference.
\stopquestion

\beginanswer
\startanswer[a:Test]
This is the answer to the second question. 

(Note that this answer has a reference named \type{a:Test}).
\stopanswer
\endanswer

\startquestion[q:Obvious]
This is the third question, an easy one, without a given solution.
\stopquestion

% we increment here the counters for Answer
\noanswer

\startquestion[q:2]
This is the fourth question with its own reference.
\stopquestion

\beginanswer
\startanswer
This is the answer to the fourth question: use the result of \in{question}[q:1].
\stopanswer
\endanswer

\startquestion 
This is the fifth question, without its own reference. 

({\it Hint:} look again at \in{Question}[q:Obvious]).
\stopquestion

\beginanswer
\startanswer
This is the answer to the fifth question. Read again \in{Answer}[a:Test].
\stopanswer
\endanswer  

\stopchapter

% Here we say ownnumber=1, in order to match the prefix 
% of numbers associated to Answer
\startchapter[ownnumber=1,title=Answers and solutions]
\useblocks[answer]
\stopchapter

\stoptext
 end interactive-question-answer.tex

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

Re: [NTG-context] Extract only certain part of document (via modes)?

2016-11-06 Thread Wolfgang Schuster

Mikael P. Sundqvist 
6. November 2016 um 12:51
Dear list, and in particular Hans,

I asked the same question on stackexchange before today
(http://tex.stackexchange.com/q/337738/52406), and got the answer that
what I want to do might not be possible.

In my large document I have exercises (typeset with \startexercise
\stopexercise, defined as an enumeration). Is it possible to use modes
(or any other trick) to be able to compile the same file and get only
the exercises. For example,

context file.tex

should give the full document, while

context --mode=exercises file.tex

should give only all the exercises (or just everything "in one mode")?
You can put each exercise in a block and ask Hans to add a \saveblocks 
commands
which writes the content of all exercise blocks to a external file (like 
\savebuffer lets

you save the content of a buffer in a external file).


\defineblock[exercise]
\keepblocks [exercise]

\defineenumeration[exercise][text=Exercise]

%\doifmode{exercises}{\saveblocks[exercise][exercises.tex]}

\starttext

\beginexercise
\startexercise
This is the first exercise.
\stopexercise
\endexercise

\beginexercise
\startexercise
This is the second exercise.
\stopexercise
\endexercise

\stoptext


The content of this saved file can then be read by another file
to get a document which contains only the exercises.


\defineenumeration[exercise][text=Exercise]

\starttext

\doiffileelse{exercise}
  {\input{exercises}}
  {{\tttf Exercise file doesn’t exist.}}

\stoptext


Wolfgang
___
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
___

Re: [NTG-context] Clickable question/answer numbers

2016-11-06 Thread Wolfgang Schuster

Otared Kavian 
6. November 2016 um 11:43
Hi Wolfgang,

Thanks for the solution you sent yesterday.
Your solutions solves the problem I was fighting with, but when I try 
to apply it to my real document there is an issue when some questions 
don’t have answers. This prevents the synchronization of Questions and 
Answers if one doesn't issue the commands

\beginanswer
\incrementcounter[answer]
\endanswer

right after a question without an answer. And when the above commands 
are issued, the last Question does not show the link to its 
corresponding Answer.


Below is your modified example where one can see the problem (please 
see the fifth Question in the source below).


Best regards: OK
 begin example-ws.tex

\setupinteraction[state=start]

\newcounter\QuestionCounter
\newcounter\AnswerCounter

\define[1]\QuestionTextCommand
  {\doglobal\increment\QuestionCounter
   \pagereference[question:\QuestionCounter]%
   \doifreferencefoundelse{answer:\QuestionCounter}
 {\goto{#1}[answer:\QuestionCounter]}
 {#1}}

\define[1]\AnswerTextCommand
  {\doglobal\increment\AnswerCounter
   \pagereference[answer:\AnswerCounter]%
   \doifreferencefoundelse{question:\AnswerCounter}
 {\goto{#1}[question:\AnswerCounter]}
 {#1}}

Add a check for triatypesetting mode to increment \QuestionCounter
only once for each question.

\define[1]\QuestionTextCommand
  {\doifnotmode{*trialtypesetting}
 {\doglobal\increment\QuestionCounter
  \pagereference[question:\QuestionCounter]}%
   \doifreferencefoundelse{answer:\QuestionCounter}
 {\goto{#1}[answer:\QuestionCounter]}
 {#1}}

\define[1]\AnswerTextCommand
  {\doifnotmode{*trialtypesetting}
 {\doglobal\increment\AnswerCounter
  \pagereference[answer:\AnswerCounter]}%
   \doifreferencefoundelse{question:\AnswerCounter}
 {\goto{#1}[question:\AnswerCounter]}
 {#1}}

%% Why this command generates an erreor?
\define\noanswer{%
\beginanswer
\incrementcounter[answer]
\endanswer}

The block environment can’t be used within a definition but
you put the content in a bufer and call then the buffer content
with your \noanswer command.

\startbuffer[noanswer]
\beginanswer
\doglobal\increment\AnswerCounter
\incrementcounter[answer]
\endanswer
\stopbuffer

\define\noanswer
  {\getbuffer[noanswer]}

Wolfgang
___
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
___

[NTG-context] Extract only certain part of document (via modes)?

2016-11-06 Thread Mikael P. Sundqvist
Dear list, and in particular Hans,

I asked the same question on stackexchange before today
(http://tex.stackexchange.com/q/337738/52406), and got the answer that
what I want to do might not be possible.

In my large document I have exercises (typeset with \startexercise
\stopexercise, defined as an enumeration). Is it possible to use modes
(or any other trick) to be able to compile the same file and get only
the exercises. For example,

context file.tex

should give the full document, while

context --mode=exercises file.tex

should give only all the exercises (or just everything "in one mode")?

/Mikael
___
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
___

Re: [NTG-context] Clickable question/answer numbers

2016-11-06 Thread Otared Kavian
Hi Wolfgang,

Thanks for the solution you sent yesterday.
Your solutions solves the problem I was fighting with, but when I try to apply 
it to my real document there is an issue when some questions don’t have 
answers. This prevents the synchronization of Questions and Answers if one 
doesn't issue the commands
 
\beginanswer
\incrementcounter[answer]
\endanswer

right after a question without an answer. And when the above commands are 
issued, the last Question does not show the link to its corresponding Answer.

Below is your modified example where one can see the problem (please see the 
fifth Question in the source below).

Best regards: OK
 begin example-ws.tex

\setupinteraction[state=start]

\newcounter\QuestionCounter
\newcounter\AnswerCounter

\define[1]\QuestionTextCommand
  {\doglobal\increment\QuestionCounter
   \pagereference[question:\QuestionCounter]%
   \doifreferencefoundelse{answer:\QuestionCounter}
 {\goto{#1}[answer:\QuestionCounter]}
 {#1}}

\define[1]\AnswerTextCommand
  {\doglobal\increment\AnswerCounter
   \pagereference[answer:\AnswerCounter]%
   \doifreferencefoundelse{question:\AnswerCounter}
 {\goto{#1}[question:\AnswerCounter]}
 {#1}}

\defineenumeration[question]
[text=Question,
headcommand=\QuestionTextCommand,
number=yes,
prefix=yes,
prefixsegments=chapter,
coupling=answer]

\defineenumeration[answer]
[text=Answer,
headcommand=\AnswerTextCommand,
number=yes,
prefix=yes,
prefixsegments=chapter,
coupling=question]

\defineblock[answer]

%% Why this command generates an erreor?
\define\noanswer{%
\beginanswer
\incrementcounter[answer]
\endanswer}

\define\PrintCounterValues{Here \type{\QuestionCounter = }\QuestionCounter.\par
Here \type{\AnswerCounter = }\AnswerCounter.\par
Here \type{\rawcountervalue[question] = }\rawcountervalue[question].\par
Here \type{\rawcountervalue[answer] = }\rawcountervalue[answer].
}


\starttext
\startchapter[title=Questions]

\startquestion[q:1]
Prove that ${\rm e}\sim 2.73$ is irrational.

This is the first question, with its own reference, for later use.

\PrintCounterValues
\stopquestion

\beginanswer
\startanswer
This is the answer to the first question (to \in{Question}[q:1]).

\PrintCounterValues
\stopanswer
\endanswer

\startquestion 
This is the second question, without its own reference.

\PrintCounterValues
\stopquestion

\beginanswer
\startanswer[a:2]
This is the answer to the second question.

\PrintCounterValues
\stopanswer
\endanswer

\startquestion
This is the third question, an easy one, without a given solution.

\PrintCounterValues
\stopquestion

%\noanswer\ % this generates an error…
\beginanswer
%\increment\AnswerCounter
%\incrementcounter[AnswerCounter]
%\increment\QuestionCounter
%\incrementcounter[QuestionCounter]
\incrementcounter[answer]
%\incrementcounter[question]
\endanswer

\startquestion[q:2]
This is the fourth question with its own reference.

\PrintCounterValues
\stopquestion

\beginanswer
\startanswer
This is the answer to the fourth question: use the result of \in{question}[q:1].

\PrintCounterValues
\stopanswer
\endanswer

\startquestion 
This is the fifth question, without its own reference. (This Question is not 
linked to its Answer).

\PrintCounterValues
\stopquestion

\beginanswer
\startanswer
This is the answer to the fifth question. Read again \in{Answer}[a:2].

\PrintCounterValues
\stopanswer
\endanswer  

\page

\stopchapter

\startchapter[ownnumber=1,title=Answers and solutions]
\useblocks[answer]
\stopchapter

\stoptext
 end example

> On 5 Nov 2016, at 19:14, Wolfgang Schuster  
> wrote:
> 
>> Otared Kavian  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