Am 2018-08-27 um 16:37 schrieb Mikael P. Sundqvist
On 27 Aug 2018, at 14:14, Mikael P. Sundqvist
wrote: Hi!
I am writing notes for my teaching and would like to do the following with modes:
* If the file is compiled with context file.tex then everything (i.e. the content in all modes) is typeset. * If the file is compiled with context --mode=test1 file.tex then only mode test1 is typeset.
I do not see how to do this easily.
This is what I would do if the list of modes is small:
\doifnotmode{test1}{\enablemode[test1,test2]}
(and don’t use the \definemode lines)
But if you need many of them, that could get problematic with many nested \doifmodeelse statements.
In that case, I would use a separate ‘all’ mode, and call the context script with that as argument in the generic case.
%%% file.tex \starttext \startmode[test1,all] We are in mode test1. \stopmode \startmode[test2,all] We are in mode test2. \stopmode \stoptext %%%
___________________________________________________________________________________
Thank you, Taco!
I have around 25 of them, and your solution with "all" works indeed well for me.
There’s also \startnotmode[some] This is not typeset in "some" mode. \stopnotmode Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD