1

I'm writing two documents (using a specific template), each of 5 pages, in one .tex file. Between them, I added

\setcounter{page}{1}

to reset the page numbering. The numbers displayed in the resulting PDF are fine: 1-5 and 1-5.

However, the PDF viewer (e.g. SumatraPDF) isn't happy with that. Instead of numbering the pages from 1-10 (e.g. for seeking a page), it has: 1-5, 1.1-5.1.

How can I keep the page numbering that I want but tell the PDF something else? It might have something to do with the PDF catalog.

Werner
  • 603,163
Zohar Levi
  • 1,237

1 Answers1

2

The following minimal example provides a way around having duplicate page numbers. The key is to add a differing TeX/PDF \thepage, together with the pdfpagelabels=false setting for hyperref.

\documentclass{article}

\usepackage{lipsum}

\usepackage[pdfpagelabels=false]{hyperref}

\begin{document}

\sloppy

% First set of 5 pages \tableofcontents \section{First section} \lipsum[1-25]

\clearpage \setcounter{page}{1}% Reset page counter \renewcommand{\thepage}{\texorpdfstring{\arabic{page}}{X\arabic{page}}}%

% Second set of 5 pages \section{Second section} \lipsum[26-50]

\end{document}

enter image description here

Under the assumption that you may have different section numbers within each component of the document, you could even do the following in the preamble:

\renewcommand{\thepage}{\texorpdfstring{\arabic{page}}{\thesection-\arabic{page}}}
Werner
  • 603,163