17

When using the comment package, one can get a very strange error

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

when compiling a file that excludes some comments

\documentclass{scrartcl}
\usepackage{comment}
\excludecomment{enonce}

\begin{document}
 \begin{enonce}
  some text
 \end{enonce}
\end{document}
ysalmon
  • 1,160

2 Answers2

22

This is clearly stated in the package manual:

The opening and closing commands should appear on a line of their own. No starting spaces, nothing after it.

enter image description here

egreg
  • 1,121,712
  • Oh you are right ! I had been searching for ages in this -- but it was late. I will amend the Q/A ; should I remove it entirely ? Maybe it could still be useful to other as a pointer. – ysalmon Oct 13 '17 at 07:13
0

One cause of this error that I found was embedding a \begin{comment} and \end{comment} within conditional braces. Once I removed the comment commands, the error disappeared.