Hello,
I have a large document, and I would like chapter page numbers at the top of the page--for example, I want the pages in chapter 1 numbered 1-1, 1-2, 1-3, and the pages in chapter 2 numbered 2-1,2-2,2-3 etc. However, I would also like global page numbers on the bottom of the page, so if chapter 2 starts on the 10th page of the document it would display '2-1' at the top of the page but '10' at the bottom. I can accomplish either of these page numberings separately by redefining \thepage, but not both at the same time.
The only thing I can think to do is define some counter for the chapter page number, and increment it whenever a new page is started. Is there any way to define a counter that is not the 'page' counter, but is incremented whenever a new page begins?
Thanks
Page Layout ⇒ multiple page numbers on the same page
multiple page numbers on the same page
Last edited by stormy on Thu Jun 17, 2010 4:05 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
multiple page numbers on the same page
Take a look at the below code. It defines a new counter for the total number of pages and add the command to increase on every page by means of the eso-pic package. The chappg package does the numbering of the page counter.
I'm sure that there is a solution that only needs some (La)TeX internal commands instead of a whole package. But I can't figure out this at the moment. The placement of the two page counters can be done either with fancyhdr or titlesec.
Thorsten
Code: Select all
\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{chappg}
\usepackage{eso-pic}
\usepackage{blindtext}
\newcounter{totpage}
\setcounter{totpage}{1}
\AddToShipoutPicture{%
\stepcounter{totpage}
}
\begin{document}
\blinddocument \thetotpage
\blinddocument \thetotpage
\end{document}
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: multiple page numbers on the same page
The \AddToShipoutPicture command was the one I needed, and it worked well. I didn't end up needing the chappg package, I was able to insert my page number simply by putting \thetotpage in the header.
Thanks for the help
Thanks for the help