0

I wrote a script with a set of coding problems, and made use of the xsim package to produce an optional sample solution. Until September, this worked fine, especially wrapping a lstlisting-enviroment by the solution-enviroment. After some updates (TexLive, the newest xsim-package, Ubuntu 22.04 LTS), my tex file wont compile when I select the "print solutions" option.

The original file is way to big to include, but I managed to make up a minmal (not working) example


\documentclass[a4paper,11pt,oneside]{scrbook}
\usepackage{listings}
\usepackage{xsim}

\begin{document}
\begin{exercise}
Do this
\end{exercise}
\begin{solution}[print=true]
        \begin{lstlisting}
            M_total = len(data)-N         
            M = int(round(0.1*M_total, 0)) 
        \end{lstlisting}
\end{solution}
\end{document}

that gives me the Emergency stop error, as well as the "Text dropped after begin of listing"-error.

In the original file however, where a lot more xsim setup happens, I keep receiving the "Paragraph ended before \lst@next was complete. \end{solution}"-error. This was discussed here, but I cant really wrap my head around this. The basic lstlisting in solution wrapping is just the same.

I found that my desired codeblock solution also does not work in the verbatim enviroment. It seems that the solution enviroment no longer can wrap the other enviroments, which is confusing to me,as up to September, everything worked fine.

Is there maybe another update that I should install? At this point, I am a little bit lost and want to restore Septembers funcionality.

The printed solution used to look like this: enter image description here

With identical source code (except minor contentwise changes), the output produced now does look like his:

enter image description here

The minimal not-working example does not produce a output file. Thanks for all constructive feedback.

3
  • 2
    your example fails for me, but this is certainly not new, it fails also in texlive 2020. You need \usepackage[use-files]{xsim} if you want to use verbatim and listings in the solutions. Dec 5, 2022 at 13:41
  • this gives the same error in texlive 2020,2021, and 2020 Dec 5, 2022 at 13:46
  • @UlrikeFischer thank you well. this prefix made the whole document work fine again. I got what I wanted but I still fail to grasp how I was able to compile this only a few weeks ago. Might it have been an instance of MikeTex that might have been installed and got purged during updates? I don't know... Then again, at this point I can't afford to care too much ;-) Thank you again for yor fix! Dec 6, 2022 at 9:25

0

You must log in to answer this question.

Browse other questions tagged .