How can I make a conditional that checks if it is currently inside a \part, \chapter, or \section?
IF inside sectioning = TRUE
DO "This text is inside a section."
ELSE
DO "This text is not inside a section."
|
How can I make a conditional that checks if it is currently inside a
|
||||
|
ConTeXt provides system modes
gives
Note that these modes are inactive when displaying table of contents. If you want to check if you are inside a table of contents (or list, in ConTeXt terminology), check for |
||||
|
|
|
|||||||
|
|
If your problem is related to this other question from you and consists in providing automatically the
so that any later usage of |
|||
|
|
\section{blah blah \mymacro{<stuff>} blah blah}where<stuff>is evaluated in a certain way depending on whether you're in a\sectionor not. Better yet, provide a more detailed description of the setting using a code example that forms part of a standard document. – Werner Nov 12 '11 at 8:28.tocfile so that it appears in the ToC. It might also be used for PDF bookmarks in a similar way. I assume you want to have this conditional to test for potential problems with the expansion when written to the.auxfile, right? – Martin Scharrer♦ Nov 12 '11 at 8:30