cgnieder / xsim

eXercise Sheets IMproved
65 stars 20 forks source link

xsim.description-list.tex does not compile #125

Open GustavoFelisbertoValente opened 3 months ago

GustavoFelisbertoValente commented 3 months ago

When I try to run the example file, I get this error:

LaTeX Error: Something's wrong--perhaps a missing \item.

l.40 \end{solutions}

muzimuzhi commented 3 months ago

Well it only happens for the first run.

Should be related to how xsim retrieves exercise and solution data from aux file(s). In the first run \printsolutions prints nothing, leaving an empty description environment. The error was raised by that empty (derived) list environment.

You can define a command to typeset a placeholder.

% in preamble
\makeatletter
\newcommand{\dummyitem}{\if@newlist\item[Rerun needed]\fi}
\makeatother

% then in "solutions" environment
\begin{solutions}
  \printsolutions
  \dummyitem
\end{solutions}