From: Fabrice L <fabrice.alpha@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: start/stop executed conditionally on mode ?
Date: Mon, 8 Jun 2020 10:54:37 -0400 [thread overview]
Message-ID: <AC28C017-41F3-48D5-8F2A-0201F44ED487@gmail.com> (raw)
In-Reply-To: <nycvar.YAK.7.77.987.2006072316450.143036@nqv-guvaxcnq>
[-- Attachment #1.1: Type: text/plain, Size: 2274 bytes --]
Dear Aditya,
> Le 7 juin 2020 à 23:19, Aditya Mahajan <adityam@umich.edu> a écrit :
>
> 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
>
Thanks for your answer, I will try that.
Fabrice,
[-- Attachment #1.2: Type: text/html, Size: 11086 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2020-06-08 14:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-08 3:08 Fabrice L
2020-06-08 3:19 ` Aditya Mahajan
2020-06-08 14:54 ` Fabrice L [this message]
2020-06-08 19:53 ` Fabrice L
2020-06-08 20:22 ` Wolfgang Schuster
2020-06-09 7:37 ` Hans Hagen
2020-06-09 16:35 ` Fabrice L
2020-06-10 6:42 ` Jan Willem Flamma
2020-06-10 7:33 ` Hans Hagen
2020-06-15 17:41 ` Henning Hraban Ramm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AC28C017-41F3-48D5-8F2A-0201F44ED487@gmail.com \
--to=fabrice.alpha@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).