开发者

how to write a LaTeX macro for conditional compiling? [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I 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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜