2

When compiling a LaTeX document, I get two pages numbered at "1": the front page and the first of the table of contents. Here's a MWE:

\documentclass[12pt,a4paper]{report}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\title{Title}

\begin{document}
\maketitle
\tableofcontents
\chapter{Chapter one}
\end{document}

When compiling this (using simply pdflatex file.tex), I get this:

enter image description here

But when I remove the line \usepackage{hyperref}, page numbers are fine. Note that I need this package to have links to pages in my table of contents, but maybe there's a better way to do so. What is happening here ? How do I get normal page numbers ?

Thanks in advance.

1

I think this is caused by the report documentclass trying to help you out by not numbering the first page, which is desired in many cases.

To get the normal page number as you want you can simply set the page counter to 2 right after the title page was made. You can do this with the command \setcounter{page}{2}.

Here is the edited MWE:

\documentclass[12pt,a4paper]{report}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\title{Title}

\begin{document}
\maketitle
\setcounter{page}{2}
\tableofcontents
\chapter{Chapter one}
\end{document}
  • It did the job, thanks. Although I'm not sure that it is caused by the report documentclass, as the same report works fine when I remove hyperref. – MeanStreet Jul 17 '18 at 12:44

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.