In C, we can write something for some part of the code, and give gcc some option
for whether we would like to compile that part of code. It saves us from modifying the C code.
In LaTex, is there a similar way for pdflatex?
Thanks.
\end{document} up to the place where you want to stop compilingDefine conditionals in order to block parts for whatever you need:
% arara: pdflatex
\newif\ifdebug
\documentclass{article}
\debugtrue
%\debugfalse
\begin{document}
\ifdebug
Debug is set to true
\else
Debug is set to false
\fi
\end{document}
In order to check for the possible use of PDFLaTeX or others, you should have a look on the packages ifpdf, ifluatex, ifxetex which define such conditionals for you. The command would read \ifpdf ... \else ... \fi and respectively for the others.
\end{document}to your desired last line. Or you search this side for conditionals, define some ruledebugtrue,debugfalseand start your code-blocks with\ifdebug. – LaRiFaRi Sep 09 '14 at 14:29pdflatexwithout touching the code again? – Tim Sep 09 '14 at 14:33