2

I receive the a Reference "LastPage" undefined error when trying to compile a document with this syntax:

\fancyfoot[R]{\thepage/\pageref{LastPage}}

What is necesarry to prevent this error? I'm using TeXworks Version 0.4.3 (MiKTeX 2.9) and pdfLaTeX.

lockstep
  • 250,273
powtac
  • 381

1 Answers1

11

\usepackage{lastpage} is required, further you need to compile at least twice. The reason is, that the first compiler run writes the reference for that label to the .aux file, in the second compiler run it can be read in.

The package lastpage defines the label LastPage, and your previous question showed that this package is used. So just compile again.

Stefan Kottwitz
  • 231,401