I'm using the exam
class like this:
\documentclass{exam}
\begin{document}
\begin{questions}
\question[1] Who's buried in Grant's tomb?
\end{questions}
\end{document}
Now I try to remove page numbers using \pagenumbering{gobble}
:
\documentclass{exam}
\pagenumbering{gobble}
\begin{document}
\begin{questions}
\question[1] Who's buried in Grant's tomb?
\end{questions}
\end{document}
And I get this error:
! Missing number, treated as zero.
<to be read again>
\relax
l.5 \question[1]
Who's buried in Grant's tomb?
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
- Why does this happen?
- What should I do to fix it?
Best Answer
You should use either
\pagestyle{empty}
or\cfoot{}
.A full MWE:
I'm not privy to the deep reasons for why the designer(s) of this document class made various design choices. All I can offer is a what is going on explanation, in terms of LaTeX code. The document class has a feature called an "incomplete question". In order to determine whether or not a given question may be incomplete, the code compares the number of the current page with the final page number of the document. If somebody -- e.g., you -- executes
\pagenumbering{gobble}
, no page numbers are available to carry out this comparison, and all the TeX program can do is crash with the 'weird error' exception.