# Creating a multi-labeled question bank with xsim/exam

I want to make a question bank on functional equations problems (in mathematical olympiads) using xsim or exam (or any other) packages.

The number of the questions is huge (around 3000) and I have 10 .tex files, each of which contains a portion of the problems (around 300 in each file). My goal is to label the problems with (say) three labels domain=R, domain=Q, and domain=Z, and then use the sub-labels cauchy-based or jensen-based for each of the labels, so that in the end I would have 6 different categories of problems. Then I want to print all problems in each of these categories in a separate chapter of a book.

I found a very similar question on TeX.SE but it doesn't have any answers. I skimmed through xsim and exam documentations and the closest thing I've found is this example from xsim, but that doesn't do what I want.

I would be really happy to hear some suggestions. Maybe there is a mysterious package that I don't know of? Please help me! Thanks.

I skimmed through xsim and exam documentations and the closest thing I've found is this example from xsim, but that doesn't do what I want.

Actually this is quite easy with xsim. (Of course the manual cannot contain examples for all different kinds of applications.) Here is a small example:

\documentclass{article}
\usepackage{xsim}

\DeclareExerciseTagging{domain}
\DeclareExerciseTagging{base}

\usepackage{filecontents}
\begin{filecontents*}{\jobname-exercises.tex}
\begin{exercise}[domain=Z,base=cauchy]
one
\end{exercise}
\begin{exercise}[domain=Z,base=jensen]
two
\end{exercise}
\begin{exercise}[domain=Q,base=cauchy]
three
\end{exercise}
\begin{exercise}[domain=Q,base=jensen]
four
\end{exercise}
\begin{exercise}[domain=R,base=cauchy]
five
\end{exercise}
\begin{exercise}[domain=R,base=jensen]
six
\end{exercise}
\end{filecontents*}

\begin{document}

\section{A}
\xsimsetup{base=cauchy,domain=R}
\input{\jobname-exercises.tex}% exercise five

\section{B}
\xsimsetup{base=jensen,domain=Z}
\input{\jobname-exercises.tex}% exercise two

\end{document}


PS: if you have such a large number of exercises xsim is probably quite slow in the processing. Also I'd strongly suggest to make use of xsim's path option.