I am working on a LaTeX document and writing at several locations. For faster compiling, I have surrounded some sections with \iffalse, \fi constructs. When I proof-read the document at the end of the day, I would like to include all those commented parts to be compiled without manually commenting the \iffalse, \fi. So I tried to define macros, but LaTeX complains, probably because the \iffalse needs to be followed by a \fi in the command definition. Is there a way to achieve this, i.e. not define a command that must by itself contain syntactically correct code, but just a macro that is substituted everywhere?

% at the end of the day, enable all sections for printing, change this in a single place here
% \newcommand{\iffalsePrint}{}
% \newcommand{\fiPrint}{}


text to appear when above is uncommented

another text

second text

third text

  • 2
    why not use the standard \newif\ifPrint command that is designed to solve this problem? Commented Feb 2, 2021 at 12:47

1 Answer 1


After tex has seen \iffalse it doesn't matter how the macros are defined as they are never expanded so your \fiPrint can not work, you could use \let\fiPrint\fi so that it is seen as \fi but there will still be issues with nested cases.

the standard mechanism is to use


To declare the commands then surround your conditional blocks with

conditional text here

The block will be used or skipped depending whether you execute \Printtrue or \Printfalse before that point to set the state of the boolean test.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .