|
|
Welcome to the TeXnik web siteifthen package |
![]() |
||||||||||
|
comment package |
ifthen package |
Print selected Textparts |
comment
By default the text in a comment-environment is totally ignored by latex. With the package comment,
which is often part of your local tex-installation, otherwise available at CTAN, the
behaviour can be changed. in latex preamble write
Print selected Parts You need ifthen-package (see next item). In the preamble you define the parts of the text which schould be printed: \usepackage{ifthen}
\newcommand\toPrint{part1}% or part2, part3 ...
In the text you write always
\ifthenelse{\equal{\toPrint}{part1}}{% all in red
....
the text for part 1 ...
...
}{}
And same for other parts.
ifthen package / Optional Text If your output depends to one ore more variables, you can use the ifthen packagem which should be part of your local tex-installation, otherwise available at CTAN.
in latex preamble write for example:
... blah ...
\ifthenelse{\boolean{PrintEquation}}{<latex text if true>}{<latex text if false>}
... blah ...
With \setboolean{PrintEquation}{false} you can toggle between the two texts.
|
|||||||||||