slatex / sTeX

A semantic Extension of TeX/LaTeX
49 stars 9 forks source link

Indented `solution` environment doesn't compile #285

Closed jfschaefer closed 3 years ago

jfschaefer commented 3 years ago

The following example doesn't compile for me because of the indented \begin{solution}...\end{solution}:

\documentclass[solutions,notes,hints,pts,min,noauxreq,mh]{hwexam}
\begin{document}
\begin{problem}[title=Test,pts=25]
    ABC
    \begin{solution}
        DEF
    \end{solution}
\end{problem}
\end{document}

I get the following error:

Processing 'solution' comment. Comment 'solution' writing to comment.cut.)
Runaway argument?
! File ended while scanning use of \next.

The following, however, compiles for me:

\documentclass[solutions,notes,hints,pts,min,noauxreq,mh]{hwexam}
\begin{document}
\begin{problem}[title=Test,pts=25]
ABC
\begin{solution}
    DEF
\end{solution}
\end{problem}
\end{document}
kohlhase commented 3 years ago

Indeed, the implementation of the solution environment uses the comment package, and that only works when the \end{solution} has no leading blanks. Michael

kohlhase commented 3 years ago

That is a "known limitation".

jfschaefer commented 3 years ago

Oh, I see. Should I close the issue or leave it open with an enhancement label?

kohlhase commented 3 years ago

feel free to do either.