[NTG-context] start/stop executed conditionally on mode ?
Aditya Mahajan
adityam at umich.edu
Mon Jun 8 05:19:50 CEST 2020
On Sun, 7 Jun 2020, Fabrice L wrote:
> Dear List,
>
> I would like to insert a page using (ideally) start/stop instructions. The problem is that this page should be inserted only in a certain mode. Consulting the mailing list, I thought the following code was working, but it’s not ! The code is executed in the mode as expected, but the following instructions ("Some other text... » in the exemple) is not typeset.
>
> Here is a minimal (not working!) example:
>
> % ————————————————————————————————————
> \unexpanded\def\StartQuestionsList{
> \startmode[ClassRoom] \page[yes] Here are some questions: \blank
> }
> \unexpanded\def\StopQuestionsList{
> \page[yes] \stopmode
> }
> \definestartstop[Questions][
> before=\StartQuestionsList,
> after=\StopQuestionsList
> ]
>
>
> \startQuestions
> Question A….
> Question B….
> \stopQuestions
>
> Some other text...
> % ————————————————————————————————————
>
>
> So to be clear, I would like the result in the « ClassRoom » mode to be:
> % ————————————————————————————————————
> Here are some questions:
>
> Question A….
> Question B….
>
> Some other text...
> % ————————————————————————————————————
>
> Otherwise to be:
> % ————————————————————————————————————
> Some other text...
> % ————————————————————————————————————
If you only set `ClassRoom` mode at compile time (rather than setting and unsetting it the middle of the document), then you can do:
\definebuffer[Questions]
\startmode[ClassRoom]
\define\StopQuestionsList {...}
\definestartstop[Questions][...]
\stopmode
Aditya
More information about the ntg-context
mailing list