how to write a LaTeX macro for conditional compiling? [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionI want to write some notes in the draft of a LaTeX document, and at a later point I want to compile the document without them. I saw someone doing something like the following (but I forgot what he did). Write notes as {\scriptsize some_text}
, and in the end replace all {\scriptsize ...}
with {}
with a \newcommand
. But I can't figure out how to write a \newcommand
to replace all {\scriptsize some_text}
occurrences by empty strings. I can then just开发者_运维技巧 comment or uncomment the \newcommand
line.
Declare in the beginning of your file
\somevariabletrue
%\somevariablefalse
so you can quickly uncomment one and comment second, and in the later part of your code:
\ifsomevariable
...
\else
...
\fi
精彩评论