I'm trying to use the comment
package inside an enumerate
environment, and it produces a compilation error. Minimal example:
\documentclass{article}
\usepackage{comment}
\specialcomment{com}{}{}
\excludecomment{com}
\begin{document}
\begin{enumerate}
\item Outside.
\begin{com}
Inside.
\end{com}
\end{enumerate}
\end{document}
This produces the following error:
Runaway argument?
! File ended while scanning use of \next.
<inserted text>
\par
For reference, everything works fine without enumerate
, as in the following example:
\documentclass{article}
\usepackage{comment}
\specialcomment{com}{}{}
\excludecomment{com}
\begin{document}
Outside.
\begin{com}
Inside.
\end{com}
\end{document}
Is this a known problem? I'm having trouble finding anything about it ("comment" isn't exactly a Google-friendly term to search for…).
Best Answer
The
comment
package has an important limitation; quoting from the documentationSo there's not much more to say about it: don't indent the environment that you want to "comment out".
Here's a different implementation; I've left the same syntax for
\specialcomment
with three arguments, although nothing is done with the second and third (it can be improved for using them).