I am trying to use cleveref
package to create custom referencing scheme for exercises created using exsheets
. I customize cross-referencing of floats and equations very well using codes similar to the one below.
The output of the code below does not show any correct referencing to any question. Even debugging using \SetupExSheets{debug=true}
shows that questions have not been tagged.
My source code
\documentclass[]{book}
\usepackage[no-math]{fontspec}
\usepackage{cleveref}
\crefformat{question}{Question. (#1)}
\crefrangeformat{question}{Questions. (#1) to (#2)}
\crefmultiformat{question}{Questions. (#1)}{ and (#1)}{, (#1)}{ and (#1)}
\crefrangemultiformat{question}{Questions. (#1) to (#2)}{ and (#1) to (#2)}{, (#1) to (#2)}{ and (#1) to (#2)}
\usepackage{exsheets}
\SetupExSheets[points]{format=\bfseries, number-format=\itshape}
\SetupExSheets{counter-format=\thesection.(qu[A]), counter-within=section}
\SetupExSheets{solution/print=true}
\SetupExSheets{debug=true,auto-label={false},ref-cmd={\cref},label-format={#1}}
\begin{document}
\chapter{My Chapter}
\section{Section 1}
\begin{question}
\label[question]{qu:1}
Question
\end{question}
\begin{solution}
\label[question]{qu:2}
Solution
\end{solution}
\begin{question}
\label[question]{qu:3}
Question
\end{question}
\begin{solution}
\label[question]{qu:4}
Solution
\end{solution}
\begin{question}
\label[question]{qu:5}
Question
\end{question}
\begin{solution}
\label[question]{qu:7}
Solution
\end{solution}
\section{Section 2}
\begin{question}
\label[question]{qu:6}
Question
\end{question}
\begin{solution}
\label[question]{qu:7}
Solution
\end{solution}
\begin{question}
\label[question]{qu:8}
Question
\end{question}
\begin{solution}
\label[question]{qu:9}
Solution
\end{solution}
\begin{question}
\label[question]{qu:10}
Question
\end{question}
\begin{question}
\label[question]{qu:10}
Question
\end{question}
\cref{qu:1,qu:2,qu:3,qu:4,qu:5}
\cref{qu:1,,qu:2,,qu:3,,qu:4,,qu:5}
\cref{qu:1,qu:6,qu:9,qu:2,qu:3,qu:4,qu:5,,qu:10}
\end{document}