| 1 |
\documentclass{article} |
| 2 |
\usepackage{xsim,lipsum,hyperref} |
| 3 |
|
| 4 |
\DeclareExerciseHeadingTemplate{custom} |
| 5 |
{\section{\XSIMexpandcode{\XSIMtranslate{default-heading}}}} |
| 6 |
|
| 7 |
\DeclareExerciseEnvironmentTemplate{custom} |
| 8 |
{% |
| 9 |
\IfInsideSolutionTF |
| 10 |
{\label{sol:\ExerciseID}} |
| 11 |
{\label{ex:\ExerciseID}} |
| 12 |
\subsection* |
| 13 |
{% |
| 14 |
\XSIMmixedcase{\GetExerciseName}% |
| 15 |
\IfInsideSolutionTF |
| 16 |
{ |
| 17 |
to \GetExerciseParameter{exercise-name}% |
| 18 |
~\GetExerciseProperty{counter}% |
| 19 |
} |
| 20 |
{% |
| 21 |
~\GetExerciseProperty{counter} |
| 22 |
\GetExercisePropertyT{subtitle} |
| 23 |
{ {\normalfont\itshape\PropertyValue}}% |
| 24 |
}% |
| 25 |
} |
| 26 |
\noindent\llap{% |
| 27 |
\footnotesize\sffamily |
| 28 |
\IfInsideSolutionTF |
| 29 |
{% |
| 30 |
\XSIMmixedcase{\GetExerciseParameter{exercise-name}} |
| 31 |
on page~\pageref{ex:\ExerciseID}.% |
| 32 |
} |
| 33 |
{% |
| 34 |
\XSIMmixedcase{\GetExerciseParameter{solution-name}} |
| 35 |
on page~\pageref{sol:\ExerciseID}.% |
| 36 |
}% |
| 37 |
\hspace*{\marginparsep}% |
| 38 |
}% |
| 39 |
} |
| 40 |
{} |
| 41 |
\xsimsetup{ |
| 42 |
exercise/template = custom , |
| 43 |
solution/template = custom , |
| 44 |
print-solutions/headings-template = custom |
| 45 |
} |
| 46 |
|
| 47 |
\begin{document} |
| 48 |
|
| 49 |
\section{Exercises} |
| 50 |
\begin{exercise} |
| 51 |
\lipsum[4] |
| 52 |
\end{exercise} |
| 53 |
\begin{solution} |
| 54 |
\lipsum[4] |
| 55 |
\end{solution} |
| 56 |
|
| 57 |
\clearpage |
| 58 |
\printsolutions |
| 59 |
|
| 60 |
\end{document} |