Using the exam
document class I'm trying to create a questions/answers-sheet for a book. When working on the first chapter, everything worked nicely. When I came to the second chapter, I realized I would have problems with the question numbering, since there are questions with the same numbers. The specific warnings I got was:
LaTeX Warning: Label `question@1' multiply defined.
The basic layout of the body of my document is as follows:
\section*{Chapter 1}
\setcounter{section}{1}
\begin{questions}
\numberwithin{question}{section}
\setcounter{question}{0}
\question
\begin{solution}
\end{solution}
\end{questions}
\section*{Chapter 2}
\setcounter{section}{2}
\begin{questions}
\numberwithin{question}{section}
\setcounter{question}{0}
\question
\begin{solution}
\end{solution}
\end{questions}
Compilation still works, but my editor is giving me a page full of warnings. There has to be a better more correct way, than what I'm doing right now. Could you recommend me a different way to make such a document?
.tex
file (starting with\documentclass
etc) so that I can reproduce your error on my machine?