Changes

Jump to navigation Jump to search
118 bytes added ,  11:39, 11 March 2019
m
closing tag much needed
<texcode>
\doifmodeelse {mode1, mode2, ...} {Processed if any mode is enabled} {else this is processed}
\doifnotmodeelse {mode1, mode2, ...} {Processed if any mode is disabled} {else this is processed}
\doifallmodeselse {mode1, mode2, ...} {Processed if all modes are enabled} {else this is processed}
\doifnotallmodeselse {mode1, mode2, ...} {Processed if all modes are disabled} {else this is processed}
</texcode>
 
Note that there is no command <code>\doifnotmodeelse</code> because there is no need for it; <code>\doifmodeelse</code> may be used for the same effect (with the <code>if</code> and <code>else</code> branches switched).
== Checking multiple modes in parallel (<code>case</code> statement for modes) ==
</texcode>
The same mode can be referenced multiple times, and '''all''' matching brances branches are executed.
The {{cmd|startmodeset}} ... {{cmd|stopmodeset}} environments can be nested. So, you can use
Sometimes you want a macro to behave differently if it is part of a section head, a section number, a list, a marking, or a register. For section heads, you can check for modes <code>*chapter</code>, <code>*section</code>, <code>*subsection</code>, etc. Similarly, <code>*list</code> is enabled inside a list, <code>*marking</code> is enabled inside a marking, and <code>*register</code> is enabled inside a register.
139

edits

Navigation menu