I want to put negative number page before the main page of a book document class.

So, I will have something like page -4, -3, -2, -1, 0 (this is the first main page), 1, 2…

I can put on the top of the document environment \setcounter{page}{-<number>} but I have to know how many pages is before the \mainmatter to put it as a <number> variable. So how can I get this value?

  • 2
    You'd need two passes for that. – jub0bs Sep 4 '14 at 19:56
  • Are you aiming for a prize for the most unexpected and unusual page numbering look? – Mico Sep 4 '14 at 21:03
  • Yes Judobs, I know that. Mico, no I was just want to do that for a long time :D – fauve Sep 4 '14 at 23:35

The following example uses package zref, in especially zref-abspage, which provides a counter for the absolute page number. \mainmatter writes a reference mainmatter with property abspage, the absolute page number, into the .aux file. In the next run, the page number is set at the beginning in \frontmatter to the negative number:



% Add label to \mainmatter for the absolute page number
  % Overwrite \pagenumbering{roman} of the original \frontmatter
  % Set the page number to the number of pages in the frontmatter
  % with reverted sign.
  % The label is already on page n + 1, the first page of the main matter.
  % Also page number 0 is available:
  % Ensure, that the first page is odd-numbered.

\chapter{Main chapter}


  • Page -3: Contents
  • Page -2: Empty page because of \cleardoublepage of the following \chapter
  • Page -1: Chapter "Introduction"
  • Page 0: Empty page because of \cleardobulepage of the following \mainmatter
  • Page 1: Chapter "Main chapter", the first page in main matter
| improve this answer | |
  • It’s good but I want to have the 0 page number on the page “Main chapter”, the first page in main matter. For this, have I to set \setcounter{page}{-\zref@extractdefault{mainmatter}{abspage}{-1}}? – fauve Sep 5 '14 at 0:22
  • @fauve However 0 is an even number, but chapters usually start with an odd page number on the right side. – Heiko Oberdiek Sep 5 '14 at 5:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.