I am using fancyhdr and lastpage.
I want to write a Bachlorthesis and the last page must be the statutory declaration wich should not be part of the page count. But this page is counted in LastPage. How can i get lastpage to not count this page ?
\setcounter{page}{\pageref*{LastPage}-1}
is what i am looking for
\documentclass[a4paper]{report}
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}
\fancypagestyle{plain}{}
\fancyhead[RO,RE]{Page \thepage\ of \pageref*{LastPage}}
\fancyhead[LO,LE]{\leftmark}
\begin{document}
% much content
% now the last page:
\thispagestyle{empty}
% content of the declaration
Best Answer
You can use the
zref
package and decrease the generated number by 1.As you can see, the declaration page is number 4.