Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Here is a minimal example that showcases my problem:

\documentclass{article}

\usepackage{amsthm}
\usepackage{hyperref}
\usepackage{cleveref}

\newtheorem{thm}{Theorem}
\newtheorem{lem}[thm]{Lemma}

\begin{document}

\begin{lem}
Lemma
\end{lem}

\end{document}

The warning I get is the following:

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

\AtBegShi@Output ...ipout \box \AtBeginShipoutBox 
                                                  \fi \fi 
l.16 \end{document}
                   {<install dir>/MiKTeX/2.9/pdftex/config/pdftex.map}]

I know that it is just a warning and that, my document will still work perfectly fine with regards to cross-referencing and hyperlinking, but I would still like to know why I am getting this warning and if anything can be done to fix it without removing functionality of the included packages.

Bonus question: Whats going on behind the scenes when this warning (or any generic 'destination with the same identifier (name{XXX.YYY}) has been already used, duplicate ignored') is produced, as this is not limited to theorem environments.

From log file:

Package: amsthm 2004/08/06 v2.20
Package: hyperref 2011/04/17 v6.82g Hypertext links for LaTeX
Package: cleveref.sty 2011/03/22 v0.17.9 Intelligent cross-referencing
Package cleveref Info: `hyperref' support loaded on input line 2157.
Package cleveref Info: `amsthm' support loaded on input line 2300.
share|improve this question
add comment

2 Answers

This is a known issue that is associated with hyperref and is discussed/answered in the UK TeX FAQ.

In answer to your "bonus question": This stems from the fact that you're using the same counter to reference two different things by virtue of

\newtheorem{thm}{Theorem}
\newtheorem{lem}[thm]{Lemma}

This tells LaTeX that you want a new environment called lem, labelled Lemma, but that is should use the same counter as the environment thm (with label Theorem). In essence, if you had used a thm before lem, then the appropriate counter increases would have occurred, eliminating the problem.


On a side note, specific to your minimal example: removing the cleveref package clears this pdfTeX warning. However, this may just be since you're trying to illustrate the problem.

If you feel like you want to get rid of all such warnings and that your "document will still work perfectly fine", you can stop pdfTeX from outputting them by using the silence package. For example, adding

\usepackage{silence}% Filter out unwanted warnings and error messages
\WarningFilter{pdftex}{destination with the same}% Remove all warnings issued by pdfTeX
                                                 % (as pdfTeX Warning: 'destination with the same'...)

to your document preamble will "silence" pdfTeX's warning starting with "destination with the same".

share|improve this answer
add comment

use this order of the packages:

\usepackage{hyperref}
    
\usepackage{amsthm}
    
\usepackage{cleveref}
share|improve this answer
1  
Thank you, that worked perfect for me! –  Dan Mar 8 '13 at 10:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.