修复垂直空间

修复垂直空间

当我在第一个问题和第二个问题之间写作时,我想阻止第二个问题向下移动。我希望问题 2 保持固定

像这样: 在此处输入图片描述

\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.
\vspace*{\stretch{1}}

\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
\end{document}

答案1

更新

如果您希望无论在第一个问题之后输入什么文本,第二个问题都固定在页面上,那么您必须事先保留空间。

此示例使用minipage宽度为\textwidth、高度为的4\baselineskip,足以容纳四行文本,如第一页所示。

第二页只写了两行。

如您所见,问题#2的位置没有改变。

X

\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}

有三个可选参数:positionheightinner-pos

position控制小页面如何与周围材料垂直对齐。

height是固定长度。它设置小页面的高度。

最后一个可选参数inner-pos控制框内内容的放置。

相关内容