Document 694

The LaTeX lastpage package

Version: 5.5 - Scientific WorkPlace & Scientific Word

The lastpage package adds a marker with the key of LastPage to the last page of your document so that you can create references to it, as in page 21 of 47.

Applying the package is useful in headers and footers. By using the lastpage package with the fancyhdr package, you can create page numbers in headers and footers that refer to the last page, as in this example:

  1. Add the lastpage and fancyhdr packages to your document.

  2. Specify a new header and footer setup in the document preamble:

    1. From the Typeset menu, choose Preamble.

    2. On a new line, type \pagestyle{fancy}.

  3. To define the content of the footer, start a new line and type the information you want right-justified in the footer, as in

    \rfoot{Page:\ \thepage\ of \pageref{LastPage}}

  4. Choose OK.

Last revised 01/30/07