I'd like to print a shorter version of my paper without all the proofs, I'm thinking about something like


but that activates the comment environment right there instead of in the code.


1 Answer 1


although the suggested question, How to redefine an environment to produce no output?, does offer ideas, it's not obvious that it's perfect.

here's an attempt to use the comment package in the way requested.

some text

proof text

more text

[Second proof]
more proof text

still more text

if the \excludecomment directive is uncommented, indeed all proofs do disappear. but there is one limitation that is mainly a nuisance:

  • if no blank lines appear before or after the proofs, all the surrounding text is run together.

in a first attempt, i assumed that it wouldn't be possible to simply specify proof as the "comment" to be excluded, so didn't even try it. (i was wrong.) instead, i defined an alternate form:


and labeled the proofs as myproof instead of simply as proof, with the following adverse result:

  • an alternate proof header, e.g. [Second proof], is not interpreted as the usual option. if this is on the same line as \begin{myproof}, it simply disappears. if on another line, with the preceding line terminated by % (as in the example code), it prints out as ordinary text.

this flaw could be fatal to your "full" presentation.

thanks to the original poster for trying out the "obvious" (and discovering that it works!), and to victor eijkhout for creating the package!

  • Hi! Just adding the excludecomment did what I needed. Thanks for your detailed answer. May 15, 2013 at 17:21
  • @DavidKohler -- ohmygosh! it does work! it wouldn't have occurred to me that it could! i'll edit the answer. May 15, 2013 at 17:25

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