I can use \pageref{LastPage}
to give the reference of last page with lastpage
package. The last page of document is the back cover so I don't want to count it. I wonder how to specify the second last page with lastpage
package. Thanks in advance for your help.
[Tex/LaTex] Referring to Second Last Page in pageref in lastpage package
cross-referencinghyperreflastpage
Best Answer
Use
refcount
to manipulate (page) reference:The reason for comparing
\value{page}
with<LastPage>-2
is because of the fact that page numbers are stepped after printing the value - different from other counters in a document. So,\AtBeginShipout
, the page counter has already been stepped and we need to insert a\label
at the end of page<LastPage>-2
in order for it to be set at the start of page<LastPage>-1
.