Search code examples
latex

Latex tag for making a comment appear or disappear in pdf?


Is it possible to tag sections of your .tex file so that you can make text appear or not?

I have a long document and would like to be able to comment a certain section in each chapter, and produce two different pdfs, one with the comments, and one without.

I read here about the \begin{comment} tag in the verbatim package. Is it possible to make this appear if I redefined the comment tag? How is this done?

Thank you.


On suggestion, included the question to tex.stackexchange.com here, however there is not much traffic on that site.


Solution

  • Answer provided by: https://stackoverflow.com/users/1968/konrad-rudolph on tex.stackexchange.com

    Yes, this is indeed possible, and it’s very simple, too: just redefine the comment environment as follows:

    \renewenvironment{comment}{}{}
    

    This will cause the comment text to be included as normal text.