Questions tagged [lastpage]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Lastpage conflicts with glossaries-extra [Solved - see comment Ulrike Fisher]

When I use the stylish article template class by M. Legrange (see https://www.latextemplates.com/template/stylish-article), I encounter two problems using this class together with the glossaries or ...
0
votes
1answer
24 views

How can I control automatically the minimum number of lines(5 lines) in last page when it ends with reference list?

How can I control automatically the minimum number of lines(5 lines) in last page when it ends with reference list? \documentclass{article} \begin{document} Hello, here is some text without a ...
0
votes
0answers
23 views

How can I control the minimum number of lines in last page?

How can I control the minimum number of lines(5 lines) in last page? \documentclass{article} \begin{document} Hello, here is some text without a meaning. This text should show what a printed text ...
2
votes
0answers
123 views

Why does `\usepackage{cleveref}` fix the conflict between (new) hyperref, amsthm, and lastpage when using tikz externalize?

This is not a duplicate of this question. Why does adding \usepackage{cleveref} solve the conflict between lastpage, hyperref, and amsthm during externalization? The known answer proposes \...
0
votes
1answer
39 views

How to set a counter like last page, so I can call its LAST value?

I read here on how to extract the value of a counter. So for my generic sols_preamble.tex I want to for example, to be able to do something like printing \foreach \n in {1,...,\theqnumber}{ \n, } ...
0
votes
0answers
49 views

Roman numbers including lastpage

In my report i use the function \lastpage. This works fine in the mainmatter, but it takes the lastpage of the mainmatter and not the lastpage of the frontmatter and inserts it. So in my table of ...
0
votes
0answers
31 views

LastPage Package, don't count included pdfs in appendix

I use the LastPage package and the fancyhdr package to create a footer that lookes like %Footer \fancyfoot[L]{\footnotesize{\doctype} {\docname}} \fancyfoot[C]{\footnotesize \thepage/\pageref{...
0
votes
1answer
208 views

Reference 'last page' undefined, only running latex twice shows wanted result

If I run lualatex on a .tex file I only get ?? as a result from 'lastpage' in my document. Then if I run lualatex a second time, the correct result (2) is shown in the document footer. Main ...
1
vote
1answer
58 views

Different text on last page

I want to add one of two different texts, depending on whether it appears on the last page. I tried this: \documentclass{article} \usepackage[angle=0, opacity=1, scale=1,position={0,0}]{background} \...
1
vote
1answer
202 views

LastPage to be set on specific page

I have a very specific issue with the LastPage Package. I'll try and explain the best I can. So I have an article. That uses: \rfoot {Page \thepage \hspace{1pt} of \pageref{LastPage}} To add the ...
1
vote
2answers
256 views

Adding text above page number on last page

I am wondering how to add the text "[Last Page]" above the page number on the last page of my latex document? Thanks. Hannah
0
votes
1answer
152 views

Refer to LastPage when its Renamed

I am trying to get my page numbering as Page X of XX and I am using the standard syntax like, \rhead{Page \thepage\ of \pageref{LastPage}} It should work fine, expect that my last page has ...
5
votes
1answer
91 views

Why does this macro break with Lastpage?

I have made a macro \@Romankern that makes roman numerals with a negative kerning between them to make them closer to each other. I named it \@Romankern to allow it to be used with \pagenumbering. ...
2
votes
2answers
125 views

automatically rescaling a document to have an even number of pages

I am trying to use the ifthen package to automatically rescale some custom vertical spaces so that if the document has an odd number of pages on the first compilation, a second compilation will reduce ...
2
votes
2answers
72 views

Ship only the last physical page (or the last two/three physical pages)

My question is related to and in continuation to Compiling only a page range or page selection I would like to output only the last page (or last two/three pages) without knowing the total number of ...
1
vote
1answer
319 views

Label last page in sequence of \includepdf commands

I am in a tricky situation. I am using NewEnviron to separate a handful of major parts of my document. Each part has its own numbering scheme and several environment-specific commands and settings. ...
0
votes
1answer
288 views

Awkward conflict between lastpage, hyperref, amsthm and tikz-external

The following code cannot correctly produce the external .pdf file of the tikzpicture. Removing any of \usepackage{amsthm}, \usepackage{lastpage}, \usepackage{hyperref} solves the issue: the auxiliary ...
4
votes
1answer
194 views

How to print a page number to a repeating header of a longtable?

The table header gets generated once and only prints: Page 1 of 2 ... on each and every page. Is there any way update the page number in the longtable header to reflect the actual current page, i....
5
votes
1answer
678 views

What are my options for inserting a back page into my document?

I'm developing a template for articles and so far I've got the title_page.tex and main_document.tex all sorted out and I'm happy with that. My problem is I also need to have a back page in the ...
3
votes
1answer
131 views

lastpage for french

Does someone know, why the package lastpage doesn't work for french? \documentclass{scrbook} \usepackage[utf8x]{inputenc} \usepackage{ucs} \usepackage{french} \usepackage{helvet} \usepackage{...
1
vote
1answer
278 views

exclude some pages from totalpage

I use the lastpage package, and I would like to set a command as \excludethispage to put at pages I don't want to be counted in the total of page summoned by \pageref{LastPage} (for example, I would ...
1
vote
1answer
492 views

Modify page number on header with scrpage2 and lastpage

I am writing a curriculum vitae using Plasmati Graduate CV Latex template. I have made some modifications in order to add both a footer and a header, using the packages scrpage2 and lastpage. I am ...
3
votes
1answer
562 views

KOMA-Script article, header 'Page x of y': total pages not displayed

My 3 pages long article having the following code in the preamble produces "Page x of ??" in the header, rather than "Page x of 3" (where x stands for current page number). What am I missing? \...
1
vote
1answer
2k views

How can I correct the \pageref{LastPage} in this file?

I use packages lastpage and answer to make multiple choice. This is my code \documentclass[12pt,a4paper]{article} \usepackage{graphicx} \usepackage{fouriernc} \usepackage{amsmath,amssymb,amsthm} \...
1
vote
1answer
123 views

Unstable page numbering in aaltothesis class?

I am trying to configure the aaltothesis class here (.cls file here). The .cls file is designed with the roman pagenumbering for the pages 2-4 i.e. for abstract pages but arabic numbers for pages 5-...
1
vote
2answers
1k views

Two column text in last paragraph latex

I am looking for a way to finish my two column document in both columns. When I get the last sheet, the text is located in just one column, like this: So, I'd like that my last paragraph located in ...
2
votes
2answers
250 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} \...
2
votes
1answer
143 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
239 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
52 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
367 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 \...
2
votes
2answers
271 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 ...
2
votes
3answers
255 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 ...
1
vote
2answers
527 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 ...
2
votes
1answer
1k 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
559 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{% \expandafter\ifx\...
2
votes
1answer
473 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.
6
votes
2answers
1k 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
813 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
750 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}} {\detokenize{\pageref{...
3
votes
1answer
374 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 ...
6
votes
2answers
2k 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 ...
5
votes
2answers
2k 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} \usepackage[...
10
votes
1answer
672 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. \documentclass{...
0
votes
1answer
2k 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
391 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 ConTeXt?...
2
votes
1answer
124 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
10k 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 %...
9
votes
1answer
2k 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
295 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 ...