2

The following code produces page numbers which show in SumatraPDF as 1, 1.1, 2. I expect the pages to be numbered 1, 2, 3. This numbering is caused by the combination of oneside option for the book document class, and the hyperref package. What is the reason for this numbering, and how can it be fixed?

\documentclass[oneside]{book}
\usepackage{hyperref}

\title{Page 1}
\author{Author}

\begin{document}
\maketitle
\chapter{Page 2}
Text
\chapter{Page 3}
Text
\end{document}
7
  • No problem here on TeXlive 2015. Commented Nov 6, 2015 at 9:18
  • I have MikTex 2.9. Perhaps it's a bug which has been corrected.
    – kaba
    Commented Nov 6, 2015 at 9:25
  • BTW, I also don't have pages 1,2,3, but rather empty,1,2. This is due to the fact that in general the title page shouldn't have a number. Commented Nov 6, 2015 at 10:04
  • 1
    hyperref defaults to passing the logical page number to the viewer. This is really helpful if you have a preface which is numbered in roman and the main part in arabic, because then you can enter pages like “iv” into the viewer and jump to the correct physical page. You can suppress this by passing pdfpagelabels=false to hyperref. Commented Nov 6, 2015 at 13:51
  • 1
    Thanks for the option-flag! What is still open though, is why the logical page number of the first chapter is 1.1? If oneside is replaced with twoside, then the 1.1 disappears.
    – kaba
    Commented Nov 7, 2015 at 16:03

1 Answer 1

2

The document from the question has the following page numbers:

Physical/absolute page vs. \thepage
1 vs. 1
2 vs. 1
3 vs. 2

Class book uses environment titlepage for \maketitle, which resets the page number to one in the end of the environment.

Package hyperref enables option pdfpagelabels by default (not in too old versions). It uses \thepage for the logical page number, that means, the pages are numbered as 1, 1, and 2:

Tested viewers with support for logical page numbers: * Evince 2.32 * AR DC 2015 * SumatraPDF 3.0

The first two show: 1 (1 of 3), 1 (2 of 3), 2 (3 of 3)

SumatraPDF shows: 1 (1/3), 1 (2/3), 2 (3/3)

Maybe, the version of SumatraPDF, you are using, is different and contains a bug.

A better page label for the title page can be set by \thispdfpagelabel{Title}. And the duplicate destination warning can be removed by locally setting pageanchor=false, because a page anchor is probably not needed for the title page (presumably no index entries to the title page, ...).

Example:

\documentclass[oneside]{book}
\usepackage{hyperref}

\title{Page 1}
\author{Author}

\begin{document}
\begingroup
  \thispdfpagelabel{Title}
  \hypersetup{pageanchor=false}
  \maketitle
\endgroup
\chapter{Page 2}
Text
\chapter{Page 3}
Text
\end{document}
1
  • SumatraPDF indeed seems to have some bug; Acrobat Reader and Foxit Reader work fine. I updated SumatraPDF from 3.0 to 3.1.1, but the 1.1 page number persists. I'll report this bug to the creators of SumatraPDF.
    – kaba
    Commented Nov 10, 2015 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .