1

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

Thanks. Hannah

  • 1
    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
2

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}

enter image description here

enter image description here

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

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.

enter image description here

\documentclass{article}

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

\fancyhf{}% Clear header/footer
\fancyfoot[C]{%
  \ifnum\value{page}=\getpagerefnumber{LastPage}%
    \begin{tabular}[b]{c}
      [Last page] \\
      \thepage
    \end{tabular}
  \else
    \thepage
  \fi
}
\renewcommand{\headrulewidth}{0pt}% Remove header rule
%\renewcommand{\footrulewidth}{0pt}% Remove footer rule (default)
\pagestyle{fancy}

\begin{document}

\sloppy\lipsum[1-50]

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.