LaTeX warning "destination with the same identifier (name{page.1}) has been already used, duplicate ignored": cause and fix
hyperref gives every page, section, figure and equation a link target whose name is built from the counter, such as page.1 or figure.2. Two targets got the same name, and pdfTeX kept the first. Links to the second one, for example from the table of contents, jump to the first.
Why it happens
- Two pages have the number 1. The
titlepageenvironment ofarticleandreportis page 1 and sets the counter back, so the page after it is page 1 again. \pagenumberingstarts the same numbering style twice, for exampleromanfor the front matter andromanagain later.- A counter is set back by hand, as in
\setcounter{figure}{0}or\setcounter{section}{0}at the start of an appendix. The name in the message is thenfigure.1orsection.1.
How to fix it
- Give the title page a numbering style of its own:
\pagenumbering{Alph}before it and\pagenumbering{arabic}after it. The title page prints no number, so the letter never shows. - Number the front matter with
\pagenumbering{roman}and the main part with\pagenumbering{arabic}, each once. - Or switch the page targets off around the title page:
\hypersetup{pageanchor=false}before it and\hypersetup{pageanchor=true}after it. - For counters you reset by hand, load
hyperrefwith the optionhypertexnames=false. The target names are then numbered through and no longer built from the counter.
A document that produces the message
\documentclass{report}
\usepackage{hyperref}
\begin{document}
\begin{titlepage}
\centering My Thesis
\end{titlepage}
\chapter{Introduction}
Text.
\end{document}The corrected document
\documentclass{report}
\usepackage{hyperref}
\begin{document}
\pagenumbering{Alph}
\begin{titlepage}
\centering My Thesis
\end{titlepage}
\pagenumbering{arabic}
\chapter{Introduction}
Text.
\end{document}Both documents were compiled with pdfLaTeX from TeX Live 2023. The first produces the message, the second compiles without an error.
Finding the line in the editor
The editor lists every error and warning of a compile run with file and line. Select an entry and the cursor jumps to that line. See Error list with jump to the line.
Related pages
- Package
hyperref - How-to Page numbers in LaTeX
- How-to Create a title page in LaTeX
- Error Label `sec:intro' multiply defined