General ⇒ managed compilation
managed compilation
Is there any possibilities to manage the compilation of tex file? Depending on some conditions some parts of tex file are compiled and some parts are not, i.e.
condition1
Hello,
%
condition2
World!
If both condition1 and condition2 are true, then the output will be "Hello, World!". Otherwise, if condition1 is false and condition2 is true, then output is "World" etc.
Thank you in advance!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
managed compilation
Code: Select all
\newif\ifcondition
\conditiontrue
\ifcondition
this will appear in your document
\fi
\conditionfalse
\ifcondition
this won't appear in your document
\fi
Tomek
managed compilation
- ifthen provides a flexible and easy-to-use way of adding conditional statements to your LaTeX. Its approach is more LaTeX'y than standard TeX if constructs. Additionally, it gives you other tools to make construction of these statements easier.
- comment lets you define a slew of environments that can each be turned on and off at build time.