# Last footnote of an Exam be “End of Exam”

I am using exam class.

I am writing an exam, and I wanted the last footnote (the final, last one to appear) to be End of Exam.

I have this:

\pagestyle{headandfoot}
\firstpageheader{AP Calculus Practice Exam A1}{ Mao Laoshi }{Senior 2}
{ Page \thepage\ of \numpages}
{Senior 2 }

\footer{}
{\iflastpage{End of exam}{Please go on to the next page\ldots}}
{}

-
It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. While solving problems is fun, setting them up is not. Then those trying to help can simply cut and paste your MWE and get started on solving problem. – Peter Grill Nov 8 '12 at 3:10

You can use

\iflastpage{<text 1>}{<text 2>}


inside \footer. <text 1> will be used in the last page, and <text 2> will be used in all other pages, except the last one; a simple example, now including the settings of the edited question:

\documentclass{exam}
\usepackage[paperheight=12cm]{geometry}% just for the example
\usepackage{lipsum}% just to generate filler text for the example

\firstpageheader{AP Calculus Practice Exam A1}{ Mao Laoshi }{Senior 2}
{Page \thepage\ of \numpages}
{Senior 2}
\footer{}
{\iflastpage{End of exam}{Please go on to the next page\ldots}}
{}

\begin{document}
\lipsum[1-7]
\end{document}


-
the \lipsum[1-30] do I have to know how many pages before the end? – MaoYiyi Nov 8 '12 at 3:20
@MaoYiyi no; \lipsum[30] only generates some pages with "dummy" text and you don't have to use it in your actual document; \iflastpage automatically will detect the last page. – Gonzalo Medina Nov 8 '12 at 3:21
@MaoYiyi in your document all you need to add is something like \footer{} {\iflastpage{End of exam}{Please go on to the next page\ldots}} {} in the preamble. – Gonzalo Medina Nov 8 '12 at 3:24
Your solutoin gave me a runaway footer issue, but answer below worked? I have none idea why. – MaoYiyi Nov 8 '12 at 4:19
@MaoYiyi did you try the exact code I posted? Did you get the error with that code or with your actual code? – Gonzalo Medina Nov 8 '12 at 4:21

One can also achieve the same result with the command \runningfooter{<text>}{<text>}{<text>}:

\runningfooter{}{\iflastpage{End of exam}{Please go on to the next page\ldots}}{Page \thepage\ of \numpages}


This allows the first page footer to be different from the rest of the pages:

\firstpagefooter{}{}{Page \thepage\ of \numpages}

-