TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My PDF document generated with LaTeX has roman numbering for the frontmatter.

My problem is: if I want to print a certain range of pages, it is very difficult to select them, because my PDF Viewer (Skim.app or Preview.app in MacOS X 10.6.8) seems to count the pages from the beginning of the PDF (1 = first page of PDF), but it displays the correct page numbers of the document (so page 1 is the first page of the mainmatter).

Is there a way to solve this so that the page numbers displayed are the same like those I have to enter in the printing dialog?

Here is a simple example:





\section{Here starts the Frontmatter}
text frontmatter


\section{here starts the mainmatter}

text mainmatter: in my PDF viewer this is page 1, but when I would like to print it, I'd have to print page 3 (selecting page 1 in the print dialog would print page i, the first page of the PDF)


\section{here comes the backmatter}
text backmatter

share|improve this question
It is possible (I'll look into it and post an answer), but it is certainly really tricky. – yo' Jan 3 '13 at 22:48
Does Adobe Reader have the correct page numbers? I'm pretty sure I've seen Reader take different numbering schemes into account. – Torbjørn T. Jan 3 '13 at 23:14
I do not know about Adobe Reader (can’t test here) but both Foxit and SumatraPDF show both numbers, the TeX number (i, ii, 1, 2, 3) and the PDF number (1, 2, 3, 4, 5). (In SumatraPDF you can even type “ii” to get to the second PDF page.) Though you still have to choose the PDF number to select the printing range. – Qrrbrbirlbel Jan 3 '13 at 23:30
@TorbjørnT. Acrobat shows the "text" page numbers and uses them in the print dialog as well, so never dare to have two pages with the same number (2 and ii is ok, but ii and ii is not). Another problem might be with a page that accidentally has no page number at all. – yo' Jan 3 '13 at 23:38
@tohecz: Seems like a serious bug in AR: The labels are just labels and every page can have the same or none. Viewers must cope with that. – Martin Schröder Jan 4 '13 at 10:35
up vote 4 down vote accepted

Thanks to the comments of Qrrbrbirlbel Torbjørn T. and I found the solution myself:

Skim.app (version 1.3.22) indeed displays both page numbers (example for first page of MWE):

enter image description here

  • it shows page "i" in the white box on the left
  • and it shows page "1 of 5" (the "real" page, starting by 1 for the first page) in the title bar of the window

Preview.app (version 5.0.1.) only displays the "real" page number (first page of PDF = 1) in the title bar

So in both applications if I choose the "real" page number from the title bar in the printing dialog, I can precisely select the page range to print.

share|improve this answer
This works similarly in Evince and Okular on Linux -- the viewer displays e.g. "ii (4 of 12)". – Joe Corneli Apr 18 '13 at 13:12

Try to put this in your preamble. We use \EveryShipout to step our new counter xpage with every shipped page, then we use \texorpdfstring to write something different in text and in PDF comments. In the PDF comments we write this number. The modification of \pagenumbering ensures that our modified numbering is used correctly everywhere.

\def\@xroman{\@xnumber{\@roman}} % repeat for every numbering style you use
\def\@xRoman{\@xnumber{\@Roman}} % repeat for every numbering style you use
\def\@xarabic{\@xnumber{\@arabic}} % repeat for every numbering style you use
share|improve this answer
thanks a lot for your help! Could your code have any side-effects on other things or features? I'm sorry, I found a simple solution to my printing problem myself (see my answer tex.stackexchange.com/a/89192/4009 ) – MostlyHarmless Jan 3 '13 at 23:32
@Martin It should work properly, I use a similar trick elsewhere myself: tex.stackexchange.com/questions/88398/… – yo' Jan 3 '13 at 23:36
The count1to package defines a counter for the physical page number (and solves this problem for DVIs). – Martin Schröder Jan 4 '13 at 10:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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