Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
Please supply a MWE, we do not know if you create the label, or if you use any packages, for instance lastpage? –  zeroth Jan 20 '12 at 17:18
    
What is a "MWE"? –  powtac Jan 20 '12 at 17:22
    
Please see this: Welcome and here is the proper link for MWE. –  zeroth Jan 20 '12 at 17:23
    
Great, thanks! Will check it... –  powtac Jan 20 '12 at 17:26

1 Answer 1

\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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.