UPDATED
If you want question #2 to remain fixed on the page regardless of the text you type after the first question, you must reserve the space beforehand.
This example uses a minipage
with a width of \textwidth
and a height of 4\baselineskip
, enough for four lines of text, as shown in the first page.
On the second page only 2 lines were written.
As you can see, the position of question #2 was not changed.
\documentclass{exam}
\begin{document}
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
Answer the questions in the spaces provided. If you run out of room
for an answer, continue on the back of the page.}}}
\end{center}
\vspace{5mm}
\makebox[0.75\textwidth]{Name and section:\enspace\hrulefill}
\vspace{5mm}
\makebox[0.75\textwidth]{Instructor’s name:\enspace\hrulefill}
\begin{questions}
\question Is it true that \(x^n + y^n = z^n\) if \(x,y,z\) and \(n\) are positive integers?. Explain.
\begin{minipage}[][4\baselineskip][t]{\textwidth}
First line.
Second line.
Third line.
Fourth line.
\end{minipage}
\question Prove that the real part of all non-trivial zeros of the function \(\zeta(z)\) is \(\frac{1}{2}\)
\vspace{\stretch{1}}
\question Compute \[\int_{0}^{\infty} \frac{\sin(x)}{x}\]
\vspace{\stretch{1}}
\end{questions}
\clearpage
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
Answer the questions in the spaces provided. If you run out of room
for an answer, continue on the back of the page.}}}
\end{center}
\vspace{5mm}
\makebox[0.75\textwidth]{Name and section:\enspace\hrulefill}
\vspace{5mm}
\makebox[0.75\textwidth]{Instructor’s name:\enspace\hrulefill}
\begin{questions}
\question Is it true that \(x^n + y^n = z^n\) if \(x,y,z\) and \(n\) are positive integers?. Explain.
\begin{minipage}[][4\baselineskip][t]{\textwidth}
First line.
Second line.
\end{minipage}
\question Prove that the real part of all non-trivial zeros of the function \(\zeta(z)\) is \(\frac{1}{2}\)
\vspace{\stretch{1}}
\question Compute \[\int_{0}^{\infty} \frac{\sin(x)}{x}\]
\vspace{\stretch{1}}
\end{questions}
\end{document}
\begin{minipage}[position][height][inner-pos]{width}
There are three optional arguments: position
, height
, and inner-pos
.
position
governs how the minipage vertically aligns with the surrounding material.
height
is a rigid length. It sets the height of the minipage.
The final optional argument inner-pos
controls the placement of contents inside the box.
\vspace*{\stretch{1}}
. Replace it with\vspace*{<lenght>}
to make room for the answer.