Specifically, how to put on the top right corner "Page {number} of {number of pages}". Example: Page 1 of 5.
Asked
Active
Viewed 328 times
1 Answers
2
use lastpage and fancyhdr package, and you need to compile twice. as follow:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lastpage}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{Page \thepage\space of \pageref{LastPage}}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\clearpage
\lipsum[1]
\clearpage
\lipsum[1]
\end{document}
ljguo
- 1,213
- 1
- 4
- 12

\AddToHooks{shipout/background}{...}/ – John Kormylo Sep 27 '22 at 00:07