• No results found

Example for lastpage This example demonstrates the use of package lastpage

N/A
N/A
Protected

Academic year: 2021

Share "Example for lastpage This example demonstrates the use of package lastpage"

Copied!
4
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Example for lastpage

This example demonstrates the use of package lastpage, v1.2n as of 2021/09/03 (HMM; JPG). The package takes no options.

For more details please see the documentation!

To hide theIkeys use option final instead of draft with the showkeys package keys

(or remove the package call from the preamble of this document).

Hyperlinks or not: If the hyperref package is loaded, the references are also hyperlinked:

Last page’s name (LastPage): IVLastPage

If the hyperref package is loaded, but the hyperlinks of the references shall be suppressed, \pageref*{...} can be used:

Last page’s name (LastPage): IV

Trademarks appear throughout this example without any trademark sym-bol; they are the property of their respective trademark owner. There is no intention of infringement; the usage is to the benefit of the trademark owner.

Tip: Use logical page numbers for the display of the pdf (in Adobe Reader DC 2021.005.20060: Edit > Preferences > Categories: Page Display > Page Content and Information: Use logical page numbers)!

If you are more ambitious in respect to your aims with this package, you might want to have a look at the pageslts package:

https://www.ctan.org/pkg/pageslts.

Save per page about 200 ml water, 2 g CO2 and 2 g wood: Therefore please print only if this is really necessary.

I do NOT think, that it is necessary to print THIS file, really (at least not after this page)!

The page (\thepage): I

Last page’s name (LastPage): IVLastPage

(2)

The page (\thepage): II

Last page’s name (LastPage): IVLastPage

(3)

The page (\thepage): III

Last page’s name (LastPage): IVLastPage

(4)

The End

The page (\thepage): IV

Last page’s name (LastPage): IVLastPage

There was the question:

\documentclass{article} \usepackage{hyperref} \usepackage{lastpage} \begin{document}

\ifnum\thepage=\pageref{LastPage} foo \else bar \fi \end{document}

producing the error “missing number, treated as zero”.

\pageref inserts a hyperlink, \pageref{LastPage} is not expandable and the code breaks.

The code does not generally work even without hyperref. \documentclass{article} \usepackage{hyperref} \usepackage{lastpage} \pagenumbering{Roman} \begin{document} \addtocounter{page}{8} \edef\here{\thepage} \makeatletter

\ifx\here\lastpage@lastpage\relax foo \else bar \fi \makeatother

\end{document}

does work, because \lastpage@lastpage contains the name of the page, exam-ple:

Page \thepage{} is page \makeatletter\lastpage@lastpage\makeatother. prints:

Page IV is page IV.

This can be broken for example by \pagenumbering{fnsymbol}.

Referenties

GERELATEERDE DOCUMENTEN

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero,

either duplex printing or printing two pages on one side of a sheet of paper with blank back side).. (These are the

Because the compilation time for this example is usually quite short, option timer is not demonstrated very

- negative Arabic numbers turned into upper-case Roman numbers (although historically there were no negative Roman numbers): \Romanbar{-12} prints -XII. - zero Arabic number

(Or move the table in the source code near the position where it floats to or use the optional footnote marks.).. Table 5 (page 6) uses float specifier H from the float package and

(In that case the thumb marks column change will occur at another point, of course.) With paper format equal to document format the document can be printed without adapting the

This example demonstrates the use of package undolabl, v1.0l as of 2015/03/29 (HMM)!. For details please see

the error message at doi.org the #X is not included, because it is interpreted as “anchor X” at page 1.2/3-.(5):<>;%A\8!$~&{}, which already is not found.) Adding