Using xsim, I have defined two custom exercise types, meditation and thoughtexperiment. They seem to work right, except for custom numbering. I'm trying to get meditation to appear as Meditation Question 13.4.7.1 (if it's in section 13.4.7, of course), and thoughtexperiment to appear as Thought Experiment Question 13-1 (-2, -3, etc) if it's chapter 13.
But I appear to be doing it wrong, as both of these appear as nothing more than 1, 2, 3, etc.
What am I doing wrong?
Using TexLive 2020 and XeLaTeX on Ubuntu.
MWE:
\documentclass[11pt,fleqn,letterpaper,twoside,openright,spanish]{book}
\usepackage{xsim}
% SET UP THE 'xsim' PACKAGE
\xsimsetup{
exercise/print = true,
print-solutions/headings = false,
}
% DEFINE CUSTOM EXERCISE TYPE: MEDITATIONS
\DeclareExerciseType{meditation}{%
exercise-env = medquest ,
solution-env = medans ,
exercise-name = Meditation Question ,
solution-name = Meditation Answer ,
exercise-template = default ,
solution-template = default ,
the-counter = \thesection.\arabic{medquest},
}
% DEFINE CUSTOM EXERCISE TYPE: THOUGHT EXPERIMENTS
\DeclareExerciseType{thoughtexperiment}{%
exercise-env = thoughtexpquest ,
solution-env = thoughtexpans ,
exercise-name = Thought Experiment Question ,
solution-name = Thought Experiment Answer ,
exercise-template = default ,
solution-template = default ,
the-counter = \thechapter-\arabic{thoughtexpquest},
}
% DOCUMENT BEGINS
\begin{document}
\setcounter{chapter}{13}
\section{Meditative stuff}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
% EXERCISES: MEDITATIONS
\begin{medquest}
What is the sound of one hand clapping?
\end{medquest}
%
\begin{medans}
If you have to answer, you shouldn't ask!
\end{medans}
\begin{medquest}
What walks on three legs?
\end{medquest}
%
\begin{medans}
A lame dog.
\end{medans}
% EXERCISES: THOUGHT EXPERIMENTS
\section{Thoughtful stuff}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
\begin{thoughtexpquest}
Imagine LaTeX were easy.
\end{thoughtexpquest}
%
\begin{thoughtexpans}
Yay!
\end{thoughtexpans}
% PRINT ANSWERS
\newpage
\printsolutionstype{meditation}
\newpage
\printsolutionstype{thoughtexperiment}
\end{document}
\xsimsetupyou mention produces an error for me:LaTeX3 Error: The key 'xsim/medquest/the-counter' is unknown and is being(LaTeX3) ignored. }. I'll be updating my MWE in a sec. – Gil Williams Jan 04 '21 at 09:26exercise/print = true. Much appreciated! – Gil Williams Jan 04 '21 at 09:27