While experimenting with xsim I found that a basic functionality for me is missing: printing solutions which repeat the exercise's text (btw: styled with tcolorbox). I could emulate a similar behavior that looked rather suboptimal:
The problem here is that (a) the question is repeated in a box that says "solution" and has a wrong counter and (b) that I can't get the box of the exercise away (tried to \let\tcolorbox\relax, but that failed).
What I want to achieve is the following:
So the question is: How can I either access the exercises text without formatting (note: I have some verbatim material in my real situation) or drop the tcolorbox around the exercise?
% arara: lualatex
\documentclass{scrbook}
\PreventPackageFromLoading{inputenc} % stop tcb from loading this
\usepackage[most]{tcolorbox}
\usepackage[clear-aux]{xsim}
\DeclareExerciseEnvironmentTemplate{tcb}
{%
\tcolorbox[breakable,drop shadow,beforeafter skip = .5\baselineskip,title =
\textbf{\GetExerciseName~\GetExerciseProperty{counter}}%
\GetExercisePropertyT{subtitle}{ \textit{\PropertyValue}}%
\IfInsideSolutionF{%
\GetExercisePropertyT{points}{ % notice the space
(%
\PropertyValue
\IfExerciseGoalSingularTF{points}
{\XSIMtranslate{point}}
{\XSIMtranslate{points}}%
)%
}%
}%
]%
\IfInsideSolutionT{%
\GetExercisePropertyT{id}{\printexercise{ltxexercise}{\PropertyValue}}%
}%
}{\endtcolorbox}
\DeclareExerciseType{ltxexercise}{
exercise-env=ltxexercise,
solution-env=ltxsolution,
exercise-name=\XSIMtranslate{exercise},
solution-name=\XSIMtranslate{solution},
exercise-template=tcb,
solution-template=tcb,
within=chapter,
}
\begin{document}
\chapter{Exercises}
\begin{ltxexercise}
Blub?
\end{ltxexercise}
\begin{ltxsolution}
Under water
\end{ltxsolution}
\begin{ltxexercise}
Quack?
\end{ltxexercise}
\begin{ltxsolution}
At the surface
\end{ltxsolution}
\section{Solutions}
\printsolutions[headings=false]
\section{Intended result}
\begin{tcolorbox}[title=Solution for exercise 1]
\tcbsubtitle{Exercise}
Blub
\tcbsubtitle{Solution}
Under water
\end{tcolorbox}
\end{document}



\l__xsim_file_path_tl. I can add some expl3 code which automatically adapts to thepathoption. – cgnieder Jul 17 '17 at 15:29