I did something different that seems to work. There are two problems, and here are the solutions:cgnieder wrote:For keeping the question and the possible answers together the logical idea would be to wrap the {minipage} around both
- The question can be separated from the answers by a page break. SOLUTION: a \nopagebreak before the {minipage} as below.
- Multi-line questions can be broken up across pages. SOLUTION: define "widow penalties", assuming questions aren't more than 2 lines long. SOLUTION: wrap the question with a {minipage}. Either way, keeping an entire paragraph on the same page is a tricky thing to pull off in LaTeX, as discussed at http://www.tex.ac.uk/FAQ-nopagebrk.html.
Code: Select all
\question[\half]{What is the airspeed velocity of an unladen swallow?}
\nopagebreak\noindent\begin{minipage}[]{\linewidth}\begin{checkboxes}{}
\choice 10 m/s
\CorrectChoice What do you mean? African or European swallow?
\choice 8 m/s
\choice 12 m/s
\end{checkboxes}\end{minipage}{}