TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have added the package \usepackage{comment} in my .tex file. But when I am adding \begin{comment} and \end{comment} it is not commenting the text I want to comment. What to do?

share|improve this question
Please edit your question and add a complete example that reproduces the problem. – Ian Thompson Feb 24 '12 at 11:36
comment manual says: "The opening and closing commands should appear on a line of their own. No starting spaces, nothing after it." Do you place your comment environment like this? – Ignasi Feb 24 '12 at 15:10
@Ignasi You're right! – Hunsu Jun 14 '14 at 15:34

I have attempted to reproduce this problem, and have only been able to come up with only one way to do that. And that is to have the following after the comment package is included:


So, if you un-comment this line the MWE below, you get the behavior you describe. With it commented, the text in red and blue does NOT show up in the output. So, check your preamble add see if there is something else that is redefining the behavior of the comment environment.

If you have another way of reproducing this behaviour, please add a MWE.


  • As @Ignasi commented, the \begin{comment} and \end{comment} need to be their own line with nothing else on that line (except for possibly trailing white space such as tabs). No space before the \end{comment} is allowed. Even a comment % character seems to results in:

    Runaway argument? ! File ended while scanning use of \next. \par




    \textcolor{red}{This text should NOT be displayed.}
    \textcolor{blue}{This text should NOT be displayed.} 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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