I met this problem when I put \label{LastPage}
after \include{chapter}
. I found that the \ref{LastPage}
turned to ??
when I used latexmk -pdf
to compile it. I tested the reason and knew that \label
after \clearpage
would turn \ref
to ??
. Here is my code
% label after \clearpage
\documentclass{article}
% \usepackage{lastpage}
\begin{document}
this is main file. \pageref{LastPage}
\clearpage
\label{LastPage}
\end{document}
I got the output
I want to know what led to this issue?