144

I get the following warning

pdfTeX warning (ext4): destination with the same identifier (name{page.1})
has been already used, duplicate ignored

when compiling the following document:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}

\title{[Title]} \author{N.N.}

\begin{document}

\begin{titlepage} \maketitle \thispagestyle{empty} \end{titlepage}

\tableofcontents \thispagestyle{empty}

\newpage

\section{[Section]}

\end{document}

I have tried find ways to get rid of this warning by searching in other places and I have read PDFTeX destination … ignored and the other question in this place pdfTeX warning: destination with same identifier has been already used, duplicate ignored (weird behavior).

David Carlisle
  • 757,742
N.N.
  • 36,163
  • 3
  • 2
    I've tried what that FAQ describes without success. – N.N. May 28 '11 at 09:15
  • 2
    Sure, the FAQ explains that when there is a separate unnumbered title page (as you have here) then the technique will not help. – Lev Bishop Jun 02 '11 at 00:56
  • 2
    Just came upon this thread. My problem is that the style file I'm required to use kills \thepage with the line \let\thepage\relax. I've tried the recommendation in the FAQ entry to no avail. – Suresh Mar 26 '12 at 01:32
  • 1
    @Suresh If the answer below does not work for you you should comment the answer and not this question. – N.N. Mar 26 '12 at 09:07
  • 1
    @N.N. I answered here because both the FAQ soln here AND the answer below don't work. so I wasn't sure where to comment. – Suresh Mar 26 '12 at 13:21
  • @Suresh: Use \pagenumbering{none} in your document to fix your problem that was caused by \let\thepage\relax in the style file (for example, in ACM's sig-alternate.cls). – mernst Dec 24 '14 at 22:31

6 Answers6

77

One way to avoid the problem is to change the (invisible) numbering style of the title page:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[pdfpagelabels]{hyperref}

\title{[Title]}
\author{N.N.}

\begin{document}

\pagenumbering{Alph}
\begin{titlepage}
\maketitle
\thispagestyle{empty}
\end{titlepage}
\pagenumbering{arabic}

\tableofcontents
\thispagestyle{empty}

\newpage

\section{[Section]}

\end{document}
egreg
  • 1,121,712
  • 66
    Another way to solve it is to disable the pageanchors for the titlepage with \hypersetup{pageanchor=false} and reactivate them later. – Ulrike Fischer May 24 '11 at 08:03
  • 3
    @UlrikeFischer: I see the difference in the PDF file between the two solutions (the one answered and yours), but which one would be a best practice? – sirdharma Oct 18 '11 at 03:48
50

As requested by the comments: Another way to solve it is to disable the pageanchors for the titlepage:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[pdfpagelabels]{hyperref}

\title{[Title]}
\author{N.N.}

\begin{document}

\hypersetup{pageanchor=false}
\begin{titlepage}
\maketitle
\end{titlepage}

\hypersetup{pageanchor=true}
\pagenumbering{arabic}
\tableofcontents

\section{[Section]}
\end{document}

It is a matter of taste which solution is better. hyperref needs page anchors with unique names e.g. to add links to the index. Changing the page numbering style as Enrico did in his answer is a logical and adequate method to do it. On the other side: If there is a part of the document where one don't need pageanchors, disabling them is also adequate.

Ulrike Fischer
  • 327,261
9

I am required to use a template from my university, hence, there is no freedom to move parts of the document into different places. My understanding is that many packages conflict with hyperref (See https://texfaq.org/FAQ-hyperdupdest), the only thing that worked for me was to load the float package before hyperref.

\usepackage{float}
\usepackage{hyperref}
  • 6
    Welcome to TeX.SE! Well, in the documentation of hyperref you can read, that hyperref should be the last package to be loaded, because it redifines a lot of commands. There are only a few exception from that mentioned in the documentation (for ecampe cleverf) ... – Mensch Jul 24 '19 at 14:03
1

I had this warning because I put \tableofcontents before abstract at the beginning of my document. It disappeared when I swapped them. This reversed order also makes more sense I guess.

I see it is not the case in your case but maybe it will help someone else like it would have helped me.

geras
  • 213
0

In my case, the warnings were caused by cases where I used display-style equations using \begin{equation} and \end{equation}, including a \nonumber command. Replacing this with \[ and \] and removing the \nonumber removed the warnings.

0

Very very late, but just in case that it helps someone else: I had a title page in an article and didn't want it to be counted as page 1 and had therefore used \setcounter{page}{1} after the title page, which caused the warning which is described in the title of this question.

I solved this problem by using instead \setcounter{page}{0} inside the title page. The number 0 didn't show up since it was a title page, the following, first page of the article got the correct number 1 and the warning disappeared.

Seems like LateX doesn't like unnumbered pages...