How do I keep questions from splitting between pages in exam? For example in the MWE below, I'd like to have a page break after Question 2 so that Question 3 can start on a new page. I don't particularly care how this is done but I imagine a vertical fill would work. Is there a command within exam
that does this? I only see the commands that specify what to do with the header/footer if there is continuation but nothing about disabling continuation.
EDIT: Is there a way to make exam
do this automatically instead of having me specify where to have a page break?
\documentclass[addpoints]{exam}
\usepackage{blindtext}
\begin{document}
\begin{questions}
\question
\blindtext[3]
\begin{choices}
\choice
\choice
\choice
\choice
\choice
\end{choices}
%
\question
\blindtext
\begin{choices}
\choice
\choice
\choice
\choice
\choice
\end{choices}
%
\question
\blindtext
\begin{choices}
\choice
\choice
\choice
\choice
\choice
\end{choices}
%
\end{questions}
\end{document}
Best Answer
The answer How to prevent page breaks in lists? ("Exam" class) by @Mico is only for protecting the choices in a multiple-choice list, not the entire question. It still allows page breaks between a question prompt and its list of options. To avoid that, just define a new environment (shown here for multiple choice):
This now protects the whole question from breaking.
Note: one problem with the above is that if I want to use the
\pointsinmargin
option, they overwrite the question number. But I'm unable to apply @Mico's code to an environment (multichoice
) in the way he does. Using the following (andmultichoice
environment instead ofmcquestion
) does not compile: