9

Is it possible to set page labels in pdfs “correctly”? Pages in my latex documents are numbered 1-x. I'd like the page labels to correspond to the actual page numbers (as mentioned here: http://pdf.editme.com/pdfua-PageLabels).

So that the first page would be “Cover”, pages—let's say—2–5 (with toc and so on) numbered with Roman literals (i, ii, iii, etc.) and pages 6–end numbered with Arabic literals. How do I achieve that?

2
  • 2
    Package hyperref also sets page labels. May 24, 2015 at 14:59
  • Thank you, how can I label the cover page „Cover“?
    – Kurztipp
    May 24, 2015 at 15:21

2 Answers 2

8

Package hyperref also adds support for the PDF page labels. It uses \thepage for this purpose.

The cover page can be labeled using \thispdfpagelabel:

\documentclass{report}
\usepackage{hyperref}
\begin{document}
\begin{titlepage}
\hypersetup{pageanchor=false}
\thispdfpagelabel{Cover}
\Huge Cover
\end{titlepage}
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\pagenumbering{arabic}
\chapter{Abc}
\end{document}

The example also disables the page label for the cover page, because it is unlikely, that it is needed (e.g., page anchors are needed for index entries). Otherwise the page anchor for the cover page (1) would clash with the page anchor for the first chapter page (also 1).

If the cover pages do not print the page number, then \thepage can be redefined, e.g., with Cover- as prefix. With a unique \thepage the page anchor does not need to be disabled, example:

\documentclass{book}
\usepackage{hyperref}
\begin{document}
\begingroup
  \renewcommand*{\thepage}{Cover-\arabic{page}}
  \pagestyle{empty}
  \Huge Cover
  \cleardoublepage
\endgroup
\frontmatter
\tableofcontents
\listoffigures
\listoftables
\mainmatter
\chapter{Abc}
\end{document}
1

As mentioned by Heiko, just use the hyperref package.

Example:

\documentclass{report}

\usepackage[pdfpagelabels,hyperindex,hyperfigures]{hyperref}

\begin{document}

Hola.  This is my cover page

\pdfbookmark[0]{Cover}{initialpage}

\end{document}

Output:

enter image description here

You must log in to answer this question.

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