TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 a long LaTeX document and I am trying to comment out lines of text using \begin{comment} text \end{comment} and while compiling the document I have the interpreter giving out:

<recently read> \@savsf 
l.429 \end{comment}
? q

Prompting me to put some input, I know only press q. Now when I add new matching comment environments, the text does not get commented out but remains there.

Is it possible that I have unpaired tags, or that there are interleaved environments conflicting? And how can I find the problem and untangle it?

(UPDATE: the text I try to comment out had inside it commented sections. When these sections are removed by cutting them out the comment environment works. Using the package verbatim)

share|improve this question
You can use backticks ` to mark your inline code as I did in my edit. A little known markup is enclosing keyboard strokes with <kbd> and </kbd>. – doncherry May 17 '11 at 21:30
I don't have much advice except some quick googling suggests this error comes up when you are in vertical mode in the wrong place (e.g. the \end{comment}). But this is a case where trying to construct a minimal example may actually lead you directly to the problem, since the problem is almost certainly something mismatched. (i.e. first construct a copy of the file with only that comment block and see if the error persists. Then start commenting out parts of that using %. etc.) – kgr May 17 '11 at 22:38

It's not clear which package you are using, nor the exact format of your code, but the comment package documentation says this:

The opening and closing commands should appear on a line of their own.

So your example should work if you code it like this:


I believe this is because the package actually scans the input file looking for \end{comment} in column 1...

share|improve this answer
indeed it does (look in column 1); we would really need the original code to provide coherent advice. note that \begin/\end{comment} won't work from within another command, either. – wasteofspace May 18 '11 at 22:32

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.