Code: Select all
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot[C]{Page \thepage\ of \pageref{LastPage}}
\usepackage{kantlipsum}
\begin{document}
\kant
\setcounter{page}{1}
\kant[1-14]
\setcounter{page}{1}
\kant[1-22]
\setcounter{page}{1}
\kant[1-5]
\end{document}
In this document, say I want to restart the page counter at certain points, but I want it to recognise the LastPage before it was reset. For example,
Code: Select all
1 of 2
2 of 2
1 of 7
2 of 7
3 of 7
4 of 7
5 of 7
6 of 7
7 of 7
1 of 4
2 of 4
3 of 4
4 of 4
Thanks.