Open mschneiderwng opened 2 years ago
I have exercises about some topic. Some are optional, some are mandatory. I would like to print the mandatory first, then the optional. The current workflow is as follows:
\documentclass[a4paper]{article} \usepackage[use-aux=false]{xsim} \DeclareExerciseTagging{optional} \DeclareExerciseCollection[topics=algebra, optional=true]{algebra-optional} \DeclareExerciseCollection[topics=algebra, optional=false]{algebra-mandatory} \xsimsetup{collect} \begin{filecontents}{exercises.tex} \begin{exercise}[topics=algebra, optional=true] a algebra question 1 optional=true \end{exercise} \begin{exercise}[topics=calculus, optional=false] calculus question 1 optional=false \end{exercise} \begin{exercise}[topics=algebra, optional=false] algebra question 2 optional=false \end{exercise} \end{filecontents} \begin{document} % collect \collectexercises{algebra-mandatory} \input{exercises.tex} \collectexercisesstop{algebra-mandatory} \collectexercises{algebra-optional} \input{exercises.tex} \collectexercisesstop{algebra-optional} \section{Mandatory} \printcollection{algebra-mandatory} \section{Optional} \printcollection{algebra-optional} \end{document}
Would it be possible to add a filter to \printcollection, such that the interface something like in the following example?
\printcollection
\documentclass[a4paper]{article} \usepackage[use-aux=false]{xsim} \DeclareExerciseTagging{optional} \DeclareExerciseCollection[topics=algebra]{algebra} \xsimsetup{collect} \begin{filecontents}{exercises.tex} \begin{exercise}[topics=algebra, optional=true] a algebra question 1 optional=true \end{exercise} \begin{exercise}[topics=calculus, optional=false] calculus question 1 optional=false \end{exercise} \begin{exercise}[topics=algebra, optional=false] algebra question 2 optional=false \end{exercise} \end{filecontents} \begin{document} \collectexercises{algebra} \input{exercises.tex} \collectexercisesstop{algebra} \section{Mandatory} \printcollection[filter={optional=false}]{algebra} \section{Optional} \printcollection[filter={optional=true}]{algebra} \end{document}
I have exercises about some topic. Some are optional, some are mandatory. I would like to print the mandatory first, then the optional. The current workflow is as follows:
Would it be possible to add a filter to
\printcollection
, such that the interface something like in the following example?