{lastpage} puts the label LastPage (\AtEndDocument) into the .aux file, allowing the user to refer to the last page of a document. This might be particularly useful in places like headers or footers.

learn more… | top users | synonyms

3
votes
2answers
89 views

Number of pages in preamble

I have tried this to use the number of pages as an option to a package: \documentclass{article} \usepackage{lipsum} \usepackage{lastpage} \usepackage{refcount} \newcounter{mylastpage} ...
1
vote
1answer
39 views

Writing value of LastPage to external file

How can I write the final value of LastPage (\pageref{LastPage}) to an external file (knowing that it needs 2-3 compiliations of the document)? (I need it to adapt a .cls file.) [Update 2016-01-29, ...
2
votes
0answers
37 views

lastpage (or pageslts) and \topskip0pt

Can anyone explain why the following mwe produces TWO pages of output? \documentclass{minimal} \usepackage{lastpage} \begin{document} \topskip 0pt Hello, world. \end{document} If I replace \topskip ...
1
vote
0answers
18 views

How to use \page[quadruple] while having a cover as last page in ConTeXt?

I am creating a personalised magazine in ConTeXt-LuaTeX. It has a cover (that what you can see before opening the magazine), existing of two .pdf files. It contains several chapters adaptive text, ...
2
votes
1answer
110 views

Newpage should start new page numbers with lastpage also

I want to keep everything in one master file and require to start new page numbers with lastpage also after each \newpage command. MWE is below. Any help will be highly appreciated. Thanks ...
3
votes
2answers
83 views

lastpage, hyperref and xifthen

I am trying to write a code for figuring if the current page is the last page. I do run into some problems, though. In my example here, the code will not run if hyperrefis loaded. Without it, it ...
3
votes
3answers
133 views

Changing page to pages if more than one page

At the beginning of my document, I need to list the total number of pages in the document. I've got a system that works most of the time (see below), but if the document only has one page, then my ...
2
votes
2answers
105 views

Resetting LastPage in scrlttr2 letters

I'm trying to find a way to add "page X of Y" to the footers of my scrlttr2 letters. At first sight, using the lastpage package and \pageref*{LastPage} works. However, as soon as multiple letters are ...
3
votes
1answer
204 views

fancyhdr and lastpage: do not count last page

I am using fancyhdr and lastpage. I want to write a Bachlorthesis and the last page must be the statutory declaration wich should not be part of the page count. But this page is counted in LastPage. ...
3
votes
1answer
61 views

How to get second last page as a number without hyperref?

I'm trying to get the second last page as a number but without having to create a hyperlink to it. What I have now is: \def\leavesecond#1#2#3!{#2} \makeatletter \AtBeginDocument{% ...
2
votes
1answer
59 views

How to create “from page xx to last page” in Table of Contents?

How can I put a page range including the number of the last page into the Table of Contents (see picture as example below) in LaTeX? I have searched in forums but found no solution.
5
votes
2answers
284 views

Adding a watermark on all pages AFTER a prespecified page

Conference submissions typically limit a document to a certain number of pages, and when I'm editing, I'd like to be able to add a watermark to mark pages that are over the limit. For example, if I ...
0
votes
1answer
260 views

Header with Image: Page number disappearing after firstpage

When I compile the following code, there's no page number after the first page. If I comment out the Geometry command at the top of the code, the page number appears well beyond the printable page. ...
4
votes
2answers
210 views

ifthenelse doesn't work in case of string comparison

I tried to use this code to place footer in all pages except the last page in which I just want an "end". \ifthenelse {\equal {\detokenize{\thepage}} ...
3
votes
1answer
181 views

Khmer page number in beamer

I have just translated gloss-khmer.ldf, which is a part of the polyglossia package. I have tried to use it with the beamer class using theme Madrid. The theorem number is displayed as a Khmer number ...
7
votes
2answers
578 views

Referring to Second Last Page in pageref in lastpage package

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 ...
0
votes
0answers
13 views

Document class breaking references [duplicate]

I am using this document class for a resume, however when I include the class, I cannot reference labels. I get the error: LaTeX Warning: Reference `LastPage' on page 1 undefined As you can see I ...
5
votes
2answers
733 views

LastPage not defined - can't get “page x of y” - even after multiple compiles

Here is my MWE: \documentclass[11pt,letterpaper,oneside,notitlepage]{article} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsmath} \usepackage{natbib} \usepackage{graphicx} ...
10
votes
1answer
165 views

How to perform mathematical operation in latex?

I am new to LaTeX. I'm working on some sample LaTeX examples. The sample I want to create a progress bar in my document. My sample code is shown below. Any help would be appreciated. ...
0
votes
1answer
250 views

Error with the lastpage package

Can somebody help me with this error: LaTeX /b/c12/cWarning:/b/c0/c Reference `lastpage' on page 1 undefined on input line 24. /b/c4/cOverfull/b/c0/c \hbox (9.14719pt too wide) has occurred while ...
3
votes
1answer
263 views

ConTeXt: How to display last page number (Page # of #) in header/footer?

In LaTeX, I could do something like: \fancyhead[R]{\HeaderFont{\thepage{}/\pageref{LastPage}}} and/or \fancyfoot[R]{\FooterFont{\thepage{}/\pageref{LastPage}}} How to achieve the same with ...
3
votes
1answer
107 views

pageslts error: very old endfloat in texlive 2013 [closed]

The package pageslts in TeX Live 2013 complains about "very old endfloat package detected", but the recent endfloat version 2.5d is loaded. A minimum working example showing this error is: ...
4
votes
2answers
5k views

PDF Latex lastpage does not work

I've added the last page package tried to display the pager but the last page wont display. What's wrong with my code, the last page will just display a "??": {.select date_format(now()," %M %d, %Y ...
6
votes
1answer
851 views

Keep getting “aux file” error with the lastpage package

Keep getting "aux file" error with the lastpage package. The same code is working in another file but not in this one (code furnished here). Please help! Thank you! \documentclass[margin, 11pt]{res} ...
8
votes
1answer
217 views

Page numbering 143/141

I have a large latex document, compiled with pdflatex. When it compiles (I compile twice, I have tried compiling thrice) the page numbers come out as: 1/141 2/141 ... 142/141 143/141 On the bottom.It ...
3
votes
1answer
420 views

Mixed up roman and arabic page numbering in foot line using pageref

In my essay, all parts before the text part have to be numbered in Roman numbers. After the title page, the table of contents gets the correct number I. The following pages containing sections are ...
11
votes
1answer
1k views

Hyperref marks lastpage as a reference

I am using the hyperref package, lastpage package and fancyhdr package. My problem is, that the number showing the amount of total pages (in the footer) is red and works like a link to the front ...
3
votes
0answers
39 views

Is there any package that supports multiple last pages [duplicate]

Possible Duplicate: How do I have two sets of page numbers in a document? I am trying to make one single file that contains several small components. Each small parts need its own last ...
6
votes
2answers
907 views

lastpage package: incompatibility with nameref package

When I try to use the nameref package together with the lastpage package (version earlier than 2013/01/28, of course) I have following two errors: ! Package lastpage Error: no auxiliary file allowed ...
1
vote
2answers
2k views

Setting page number with fancy without lastpage package

I am using the following code to generate footer with fancy to show the page number \documentclass[twoside,a4paper,10pt]{article} \usepackage{lastpage} \usepackage{fancyhdr} \pagestyle{fancy}% ...
2
votes
1answer
519 views

fancyfoot on the last page

On the last page of my document, I need to add Next Review Date: blah blah. If I add the text at the bottom of the document, there is a possibility that the text might appear on a new page on its ...
9
votes
1answer
367 views

How do I have two sets of page numbers in a document?

I want to have two sets of page numbers (P and p) in my document. The first one (P) is global, the second one (p) resets to 1 at some predefined points. So, the document will look like, Text P1/5 ...
10
votes
3answers
1k views

Forcing even number of pages in output (LaTeX — pdflatex) [duplicate]

Possible Duplicate: How to keep the last page number even? Is there a way of forcing an even number of pages in output ? What I mean is to make pdflatex document "intelligent" it will add ...
10
votes
3answers
2k views

Stop page count before appendix

I'm trying to find a way to stop the page count in my report. So the count stops, then it comes to the appendix. Then have a separate count for the appendix, with the footer also changing so when the ...
1
vote
1answer
2k views

Reference undefined

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 ...
13
votes
2answers
9k views

How can I get no header but still get “page x of y” in footer?

I'd like to get "page x of y" in a footer on each page, and the way I've found is to use: \usepackage{fancyhdr} \usepackage{lastpage} \pagestyle{fancy} \cfoot{Page \thepage\ of \pageref{LastPage}} ...
8
votes
4answers
601 views

How to keep the last page number even?

I want to make sure the last page always be even, so I defined command as the following: \documentclass{article} \usepackage{lipsum} \usepackage[paperwidth=302pt,paperheight=400pt, offset=0pt, ...
1
vote
2answers
4k views

Bibtex references not compiling because of LastPage package?

I am trying to compile an essay and it has references in it. I am using BibTeX and XeLaTeX. Here are the last few lines of the log LaTeX Warning: Reference `LastPage' on page 4 undefined on input ...
6
votes
1answer
6k views

Why does \pageref{LastPage} give me “??” rather than page number of the last page?

I am trying to use the lastpage package in order to have footers with the page number given in the form "Page x of y", where y is the page number of the last page. This should be straightforward, but ...
17
votes
5answers
624 views

Reverse page numbering

How can one make LaTeX print the pages numbering in reverse order, in the sense that if the document in question has N pages then the first page is numbered N, then N-1, ...?
12
votes
2answers
4k views

How do I make sure that \pageref{LastPage} doesn't get colored like the other links identified by hyperref?

I am using hyperref together with lastpage. My problem is that \pageref{LastPage} gets the same color as the links identified with hyperref. I want it to be just the ordinary color (e.g. black) Allow ...
0
votes
1answer
1k views

\pageref and hyperref [closed]

Please can anyone tell me the source of the following error? I simply entered \label{xlastpage} on last page and the call \setkeys[KV]{fam}{lhead={Page \thepage of \pageref{xlastpage}}} gave ...
121
votes
9answers
49k views

How can I add “page # of ##” on my document?

I want to add a footer to my document displaying the current number out of total number of pages. How do I do that?