I try to convert from exsheets to xsim but I fail to implement runin. I just copied the runin-template from the manual (http://ftp.math.purdue.edu/mirrors/ctan.org/macros/latex/contrib/xsim/doc/xsim_manual.pdf) but I cannot compile it (error: runaway argument? {par \vspace {\baselineskip} \Needspace*{...). Does anybody know why or how I could implement runin?
Here I my source-code
\documentclass[11pt, a4paper, parskip=full]{scrartcl}
\renewcommand\thesection{\Alph{section}}
\usepackage{xsim}
\xsimsetup{%
exercise/within = subsection ,
exercise/the-counter = \thesubsection.\arabic{exercise}
}
\usepackage{needspace}
\DeclareExerciseEnvironmentTemplate{runin}
{%
\par\vspace{\baselineskip}
\Needspace*{2\baselineskip}
\noindent
\textbf{\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}}%
\GetExercisePropertyT{subtitle}{ \textit{#1}} % <<< notice the space
\IfInsideSolutionF{%
\GetExercisePropertyT{points}{%
\marginpar{%
\printgoal{\PropertyValue}%
\GetExercisePropertyT{bonus-points}{+\printgoal{\PropertyValue}}%
\,\IfExerciseGoalSingularTF{points}
{\XSIMtranslate{point}}
{\XSIMtranslate{points}}%
}% }%
}% }
{}
\DeclareExerciseType{problem}{
exercise-env = exercise ,
solution-env = solution ,
exercise-name = Aufgabe ,
solution-name = Aufgabe ,
exercise-template = runin ,
solution-template = runin
}
\begin{document}
\selectlanguage{ngerman}
\section{Aufgaben}
\subsection{subsection}
\begin{exercise}[subtitle=test]
Was ist 1 mal 1?
\end{exercise}
\begin{solution}
1 mal 1 ist 1. siehe \ref{abba}
\end{solution}
\begin{exercise}
Was ist 2 mal 2?
\end{exercise}
\begin{solution}
2 mal 2 ist 4.
\end{solution}
\section{Schwere Aufgaben}
\subsection{subsection}
\begin{exercise}
Was ist 3 mal 3?
\end{exercise}
\subsection{subsection}
\begin{solution}
3 mal 3 ist 9.
\end{solution}
\begin{exercise}
Was ist 4 mal 4?
\end{exercise}
\begin{solution}
4 mal 4 ist 16.
\end{solution}
Lösungen
\printsolutions
\end{document}