is there any way to hide all images, equations and all listings (embedded by using lstlisting package) manually by setting a certain command in the preamble? It would just be interesting to see how many pages of real 'text' the document contains actually. Thanks!

Edit: I tried using Stefans suggestion:


whereas I have the verbatim-package in the preamble. I'm getting the same error message as if when using Martins suggestion:

File ended while scanning use of \next for a command line `\include{main/02}`

When not using the commenting-stuff, there's no error while compiling the document :(

Edit2: I found out that Martins solution works but not for equations which I insert via:


and than:


Which way to take therefor?

  • Placing the comment environment into another environment doesn't work, like for any verbatim environment, because \begin{comment} then can't find it's \end{comment}. My small example works, but I can't say what's goes wrong with your file. You don't have an environment split over two input files, or something similar? – Martin Scharrer Jun 28 '11 at 20:24

You can use the comment package to turn an environment, even an existing one, into a comment environment. It skips the content verbatim so it can also be used for lstlistings, etc. However, it seems the \end{<env>} (actually the internal \end<env>) is still executed, so you need to blank that too. For macros you need to define dummy replacements with the same set of arguments.




% Also possible:

% For your funny equation marks use: (you then actually don't need to redefine `equation` itself)
% or
% \def\beq#1\eeq{}


Normal text

    (A figure)
    \caption{A figure indeed}



  • I edited my answer above Martin :) – tim Jun 28 '11 at 20:25
  • @Marc: The \beq and \eeq macros also hide the equation end-macro. See my updated answer. – Martin Scharrer Jun 28 '11 at 20:29

You could redefine all those environments and commands to do nothing, using \renewenvironment. Of course this can be summarized in one macro.

  • 2
    How can I redefine the figure command to do nothing? Martin's answer doesn't work for me. – LordStryker Mar 25 '14 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.