You can also have sections of your document that are included depending on the setting of a flag:
A flag is simply the name of a TeX command. A flag is considered set if the command is defined and its expansion is neither empty nor the single character "0" (zero).\begin{ifset}{
flag} Flag flag is set!\end{ifset}
\begin{ifclear}{
flag} Flag flag is not set!\end{ifset}
You could for instance select in the preamble which parts of a document you want included (in this example, parts A and D are included in the processed document):
Note that it is permitted to redefine a flag (using\newcommand{\IncludePartA}{1} \newcommand{\IncludePartB}{0} \newcommand{\IncludePartC}{0} \newcommand{\IncludePartD}{1} ... \begin{ifset}{IncludePartA} Text of part A \end{ifset} ... \begin{ifset}{IncludePartB} Text of part B \end{ifset} ... \begin{ifset}{IncludePartC} Text of part C \end{ifset} ... \begin{ifset}{IncludePartD} Text of part D \end{ifset} ...
\renewcommand
)
in the document. That is particularly useful if you use these
environments in a macro.