如何在標題中包含一個框框? (考試資料類)

如何在標題中包含一個框框? (考試資料類)

我有一個框,我想將其包含在標題中,而不是在每個頁面中手動重複它。我怎樣才能做到這一點?

\documentclass[addpoints, 12pt]{exam}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[nameinlink]{cleveref}

\pagestyle{headandfoot}
\firstpageheader{\large\bfseries Astronomy Exam\\ \bigskip
\large\bfseries Last Name:\enspace\makebox[1.9in]{\hrulefill}}
{}
{\large\bfseries Univ ID: \makebox[2in]{\hrulefill} \\  \bigskip
 \large\bfseries First Name:\enspace\makebox[2in]{\hrulefill}}
\runningheader{\large\bfseries Last Name:\enspace\makebox[1.9in]{\hrulefill}}
{}
{\large\bfseries First Name:\enspace\makebox[2in]{\hrulefill}}
\firstpagefooter{}{}{}
\runningfooter{}{\thepage}{}

\begin{document}

\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
Answer the questions in the spaces provided on the
answer sheets.}}}
\end{center}

\begin{questions}

\question

\newpage

\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
Answer the questions in the spaces provided on the
answer sheets.}}}
\end{center}

\question
\end{questions}

\end{document}

答案1

我使用geometry-Package 來調整標題的高度和寬度,以便它實際上可以適合頁面的頂部。

然後我將左、中、右標題全部合併到左標題中,這使得組織和間隔所有內容變得更加容易。我試著盡可能地堅持你最初的佈局。

這是工作範例:

\documentclass[addpoints, 12pt]{exam}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[nameinlink]{cleveref}

\usepackage[top=5.5cm,left=2.5cm,right=2.5cm]{geometry}


\pagestyle{headandfoot}
\firstpageheader{\large\bfseries Astronomy Exam  \hspace{4.3cm} Univ ID: \makebox[2in]{\hrulefill}\\ \bigskip
\large\bfseries Last Name:\enspace\makebox[1.9in]{\hrulefill} \large\bfseries
First Name:\enspace\makebox[2in]{\hrulefill}
\begin{center}
    \fbox{\fbox{\parbox{5.5in}{\centering\small
    Answer the questions in the space provided on the
    answer sheets.}}}
\end{center}
}
{}
{}


\runningheader{
    \large\bfseries Last Name:\enspace\makebox[1.9in]{\hrulefill} \large\bfseries
    First Name:\enspace\makebox[2in]{\hrulefill}
    \begin{center}
        \fbox{\fbox{\parbox{5.5in}{\centering\small
        Answer the questions in the space provided on the
        answer sheets.}}}
    \end{center}
}
{}
{}
\firstpagefooter{}{}{}
\runningfooter{}{\thepage}{}

\begin{document}


\begin{questions}

\question This is a question.

\newpage


\question This is another question.
\end{questions}

\end{document}

相關內容