0

I have a box that I'd like to include in the header, instead of manually repeating it in every page. How can I achieve that?

\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 Answer 1

2

I used the geometry-Package to adjust the height & width of the header so it could actually fit on the top of the page.

Then I merged the left, middle, and right header all into the left header, that made organizing and spacing everything a lot easier. I tried to stick to your initial layout as much as I could.

Here's the working example:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .