4

I would like to include exercises in an appendix of a book and I have a problem to obtain correct numbers for these exercises:

\documentclass{book}
\usepackage{exsheets}
\SetupExSheets{
  counter-within = chapter ,
  counter-format = ch.se.qu
}
\begin{document}

\chapter{foo}
\section{foo one}
\begin{question}
  foo one
\end{question}

\appendix
\chapter{bar}
\section{bar one}
\begin{question}
  bar one
\end{question}

\end{document}

For section 1 in Appendix A, I would expect a number of A.1.1 for the first question in that section. However, I get 1.1.1 which is the correct number for the first chapter outside the appendix. Accordingly, numbers are as 2.1.1 for Appendix B etc.

enter image description here

What do I need to do to obtain the expected result?

1

You could use another \SetupExSheets command after \appendix with counter-format=ch[A].se.qu to enable uppercase numbers for the chapter counter.

\documentclass{book}
\usepackage{exsheets}
\SetupExSheets{
  counter-within = chapter ,
  counter-format = ch.se.qu
}
\begin{document}

\chapter{foo}
\section{foo one}
\begin{question}
  foo one
\end{question}

\appendix

\SetupExSheets{
  counter-format = ch[A].se.qu
}

\chapter{bar}
\section{bar one}
\begin{question}
  bar one
\end{question}


\chapter{Another one}
\section{Foo}
\begin{question}
  bar one
\end{question}

\end{document}

enter image description here

  • With an up to date exsheets the following suffices for the whole document: counter-format = \thesection.qu. – cgnieder Apr 13 '16 at 21:03
  • @clemens Thanks for the hint! It works great with the 0.20 exsheets version! I noticed that there is also a counter-format = \thechapter.qu option to get the ch.qu version right with appendices. – Thomas Apr 13 '16 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.