I'm using comment and amsthm packages for comments and theorems. I'd like to skip some theorems. I've tried to create a new environment with theorem nested in a comment:



\begin{envDef}My definition.\end{envDef}

But I've got an error:

! File ended while scanning use of \next.

Did I miss something?

UPDATE: When I comment out the theorem environment directly, then LaTeX emits exactly the same error:


! File ended while scanning use of \next.

You can't hide an environment marked with \excludecomment inside another environment's definition. The and \end{myblock} tag must appear explicitly in the input, because it's taken as a literal delimiter.

The solution is simpler:

% \excludecomments{envDef} % uncomment for not showing `envDef`


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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