Page Layoutexplicit page numbering page x of y

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
kent
Posts: 57
Joined: Thu Oct 20, 2016 3:41 pm

explicit page numbering page x of y

Post by kent »

Say I have a document with 103 pages.
How can I make the pagenumbering lik 1(103), 2(103), etc.?
Kent

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

explicit page numbering page x of y

Post by Stefan Kottwitz »

Hi Kent,

you can use the lastpage package. You need to compile two times to get the reference to the last page.

Code: Select all

\documentclass{article}
\usepackage{blindtext}
\usepackage{lastpage}
\usepackage{fancyhdr}
\pagestyle{fancy} 
\cfoot{\thepage(\pageref{LastPage})}
\begin{document}
\Blinddocument
\end{document}
Stefan
LaTeX.org admin
kent
Posts: 57
Joined: Thu Oct 20, 2016 3:41 pm

explicit pagenumebering

Post by kent »

Thanks again for good and fast help!
One question, using your code:
At the last page of the my document I have a reference section (\begin{the bibliography}...\end{thebibliography}).
Strangely, this activates a left and right header REFERENCES to be printed on the last side. Headers are not written to any page in your
file. Any comments? (I get rid of the problem by explicitly defining \lhead{} and \rhead{} in my Latex file.)
Kent
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

explicit page numbering page x of y

Post by Stefan Kottwitz »

It depends on how your document class defined the thebibliography environment. Which document class are you using?

Maybe simply insert \lhead{} and \rhead{} before the bibliography. Normally the class feature should be modified.

Stefan
LaTeX.org admin
Post Reply