# Adding text above page number on last page

I am wondering how to add the text "[Last Page]" above the page number on the last page of my latex document?

Thanks. Hannah

• Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. In particular, which document class are you using? – CarLaTeX Dec 3 '18 at 6:08

IMHO, it is difficult to do so using fancy. However, with a childlike thinking just for fun, I think that this may work:

\documentclass{article}
\pagestyle{plain}
\usepackage[margin=1in]{geometry} % For nice-looking document only
\usepackage{lipsum}
\begin{document}
\lipsum[1-33]
\vfill
\centering [Last Page]
\end{document}

• You can also do \AtEndDocument{\par\vfill\centering [Last Page]} in the document preamble. – Werner Dec 3 '18 at 6:32

Since you're dealing with headers/footers, you can use fancyhdr and condition on whether you're on LastPage or not. Based on this conditioning, you can set whatever you want in either case.

\documentclass{article}

\usepackage{lastpage,fancyhdr,refcount}
\usepackage{lipsum}

\fancyfoot[C]{%
\ifnum\value{page}=\getpagerefnumber{LastPage}%
\begin{tabular}[b]{c}
[Last page] \\
\thepage
\end{tabular}
\else
\thepage
\fi
}