You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print-solutions/headings=false works fine print-solutions/chapter=true does not work
I use \printsolutions[chapter=true]
localy to print only the current chapter solutions.
My understanding of the manual is that you can set all options globally (xsimsetup) or locally.
Can you clarify why there is a difference between using these settings?
I can't see any difference in the manual.
Thanks.
The text was updated successfully, but these errors were encountered:
You're right, the setup with \xsimsetup{ print-solutions/chapter = true } does not work. The reason is that it sets \l_xsim_printsolutions_chapter_int to the current value of the chapter counter. In the preamble this is 0…
I agree that this is not obvious from the manual.
A possible solution is to add this to the \@chapter command:
\documentclass{report}
\usepackage{xsim}
\xsimsetup{print-solutions/chapter=true}
\ExplSyntaxOn\AddToHook {cmd/@chapter/after} {
\int_set:Nn \l_xsim_printsolutions_chapter_int { \value{chapter} }
}
\ExplSyntaxOff\begin{document}
\chapter{A}
\begin{exercise}
a
\end{exercise}
\begin{solution}
a
\end{solution}
\printsolutions\chapter{B}
\begin{exercise}
b
\end{exercise}
\begin{solution}
b
\end{solution}
\printsolutions\end{document}
I work with global options. My setup:
print-solutions/headings=false
works fineprint-solutions/chapter=true
does not workI use
\printsolutions[chapter=true]
localy to print only the current chapter solutions.
My understanding of the manual is that you can set all options globally (xsimsetup) or locally.
Can you clarify why there is a difference between using these settings?
I can't see any difference in the manual.
Thanks.
The text was updated successfully, but these errors were encountered: