# coverpages at the end of exam documentclass

I'm using the exam documentclass, and currently have

\pagestyle{headandfoot}
\runningfooter{foo}{Page \thepage\ }{\iflastpage{End of Paper}{bar}}


to instruct students when the exam has ended.

Our university now requires that we print instructions on the back cover of the exam. I want to add these without interfering with the existing footers. Thus, I think I'm looking for something like coverpages, but at the end of the document.

(It would be nice to ensure that the back cover is an even page number, but I'm happy to hardcode that.)

• \clearleftpage will ensure that the following text is placed on an even page for two-sided documents or on the next page if one-sided (based on https://tex.stackexchange.com/a/11709/36296)

• With \AtEndDocument the text is automatically placed at the end without interfering with your footline.

\documentclass[twoside]{exam}

\usepackage{lipsum}

\makeatletter
\newcommand*{\clearleftpage}{%
\clearpage
\if@twoside
\ifodd\c@page
\hbox{}\newpage
\if@twocolumn
\hbox{}\newpage
\fi
\fi
\fi
}
\makeatother

\runningfooter{foo}{Page \thepage\ }{\iflastpage{End of Paper}{bar}}

\AtEndDocument{\clearleftpage bla}

\begin{document}

\lipsum
\lipsum

\end{document}


• Thank you @samcarter. Do you know how I can replace the headers and footers in the \AtEndDocument? – Colin Rowat Feb 21 '18 at 8:49
• @ColinRowat You can include setting another page style within the \clearleftpage command – user36296 Feb 21 '18 at 9:24
• @ColinRowat You're welcome! – user36296 Feb 21 '18 at 11:06