LaTeX forum ⇒ 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).
kent
Posts: 15
Joined: Thu Oct 20, 2016 3:41 pm

explicit page numbering page x of y

Postby kent » Wed Jan 11, 2017 3:09 pm

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

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8039
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed Jan 11, 2017 4:50 pm

Hi Kent,

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

  1. \documentclass{article}
  2. \usepackage{blindtext}
  3. \usepackage{lastpage}
  4. \usepackage{fancyhdr}
  5. \pagestyle{fancy}
  6. \cfoot{\thepage(\pageref{LastPage})}
  7. \begin{document}
  8. \Blinddocument
  9. \end{document}


Stefan
Site admin

kent
Posts: 15
Joined: Thu Oct 20, 2016 3:41 pm

Postby kent » Thu Jan 12, 2017 12:20 pm

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: 8039
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Jan 12, 2017 12:31 pm

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
Site admin


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 1 guest