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}

2 Answers 2

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

1
  • 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
    Commented Oct 13, 2017 at 7: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.

1
  • Well, but how does it solve the issue here? OP wants to use comment, you removed it ...
    – Mensch
    Commented Aug 5, 2019 at 17:34

You must log in to answer this question.

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