14

I have a bunch of warnings as follows:

l.3387 \end{align}
                  pdfTeX warning (ext4): destination with the same identifier (
name{equation.0.24}) has been already used, duplicate ignored
<to be read again>
                   \relax
l.3392 \end{align}

However, I haven't duplicated naming any equations or figures.

Then it is finished off with:

LaTeX Warning: There were multiply-defined labels.

Again, there are no ?? in the document and nothing was labeled with the same name.

What can cause this, and how can it be avoided?

I have equations and figures labeled that aren't referenced since I didn't know if I would reference it so I labeled it any ways. Is that an issue?

Just to verify, I am not using equation or eqnarray environments.

enter image description here

Here is possibly the important stuff from the preamble:

\documentclass[11pt, letter]{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{capt-of}
\usepackage{subfig}
\captionsetup[subfigure]{labelformat = parens}
\usepackage[pdfencoding = auto, psdextra, bookmarksdepth = 4]{hyperref}
\usepackage[noabbrev]{cleveref}
\usepackage{bookmark}
\usepackage[all]{hypcap}

I label the items as \label{somenameIcreate}. If it is a figure, I name it after the .tex file that created the standalone graphic. So if I created a graphic in a tex file called ellipticaltrajmars.tex, its label would be \label{ellipticaltrajmars}.

Would .aux file have anything useful in it? I know it has labels, but what would I be looking for in it if there was something to gleam from it?

  • 2
    That warning comes from hyperref. Try adding \hypersetup{pageanchor=false} before that section (fingers crossed because I don't know the context) – percusse Aug 1 '13 at 14:26
  • @percusse so I put that in front of every section, subsection, and subsubsection. There are fewer of them now but still quite a bit. – dustin Aug 1 '13 at 14:42
  • @Markus I wish I could. I have tried and don't know what I need to do make a MWE. – dustin Aug 1 '13 at 14:42
  • Just remove stuff in your input file until you isolate the warning. This may be time-consuming, but it's necessary. Without an MWE, any accurate diagnosis is impossible. – jub0bs Aug 1 '13 at 15:03
  • 1
    As a random guess (lacking an MWE), document classes with e.g. roman page numbering for front matters (Intro, declaration, ToC) and main matter (the text itself) can cause this issue, see tex.ac.uk/cgi-bin/texfaq2html?label=pdfpagelabels – ach Aug 1 '13 at 16:03
13

After some experiments, I figured out the cause of the problem; the following MWE allows to reproduce the problem:

\documentclass{article}
\usepackage{amsmath}
\usepackage{chngcntr}
\usepackage[pdfencoding = auto, psdextra, bookmarksdepth = 4]{hyperref}
\usepackage[noabbrev]{cleveref}

\counterwithin{equation}{section}

\begin{document}

\section{Test section}
\ref{equ:testa}~\ref{equ:testb}

\begin{subequations}
\begin{align}
a=b\label{equ:testa}
\end{align}
\end{subequations}

\section{Another test section}

\begin{subequations}
\begin{align}
c=d\label{equ:testb}
\end{align}
\end{subequations}

\end{document}

This code produces the following warning message:

warning (ext4): destination with the same identifier (name{equation.0.1}) has b
een already used, duplicate ignored

\AtBegShi@Output ...ipout \box \AtBeginShipoutBox 
                                                  \fi \fi 
l.28 \end{document}
                   pdfTeX warning (ext4): destination with the same identifier 
(name{equation.0.1a}) has been already used, duplicate ignored

\AtBegShi@Output ...ipout \box \AtBeginShipoutBox 
                                                  \fi \fi 
l.28 \end{document}
                   ] (./a.aux) )

The problem is here:

\usepackage[pdfencoding = auto, psdextra, bookmarksdepth = 4]{hyperref}
\usepackage[noabbrev]{cleveref}

\counterwithin{equation}{section}

Using \counterwithin after cleveref produces a bad interaction with hyperref+cleveref (if one comments out the line loading cleveref, the problem disappears). The solution is to move the line \counterwithin before loading cleveref:

\usepackage[pdfencoding = auto, psdextra, bookmarksdepth = 4]{hyperref}
\counterwithin{equation}{section}
\usepackage[noabbrev]{cleveref}
  • 1
    You are the best. I would have never figured out this MWE to duplicate the error. – dustin Aug 2 '13 at 2:03
1

I believe that the problem is with counters. If we set the equation counter manually, then it results in such type of problems. Consider the following example:

\documentclass{article}

\usepackage{hyperref}
\usepackage{amsmath}

\begin{document}

   \begin{equation}
      \mbox{Equation is given number but nonumber restores the value of equation counter.}\nonumber
   \end{equation}

   \begin{equation}
      \mbox{This equation is assigned the same number as the previous one because counter was reset.} 
  \end{equation}

\end{document}

Here we get the warning. But If we use starred version of equation i.e. \begin{equation*}...\end{equation*}instead \nonumber as following:

\documentclass{article}

\usepackage{hyperref}
\usepackage{amsmath}

\begin{document}

   \begin{equation*}
      \mbox{Equation is not given any number.}
   \end{equation*}

   \begin{equation}
      \mbox{This equation is assigned unused number.} 
  \end{equation}

\end{document}

and there is no warning. Same happens for the MWE provided by Gonzalo Medina, subequation - counter being reset on section change. If we use align environment with /nonumber, then this problem does not occur. The reason being /nonumber is handled in a different way.

1

OK, I traced the problem down. Here is a minimal example that reproduces the problem:

\documentclass{minimal}
\usepackage{amsmath}
\usepackage{hyperref}
\begin{document}
\begin{equation}\tag{1}
  1
\end{equation}
\begin{equation}
  2
\end{equation}
\end{document}

The problem arises when you use amsmath and hyperref packages, use the \tag command inside an equation environment, and use another equation environment later.

To avoid this problem, change the equation environment where you use \tag to gather. (No need to change equation environments where you don't use \tag.)

  • it's really bad to use successive equation environments with no intervening text. i wasn't aware of the problem with hyperref, but will make a note to document it. – barbara beeton Apr 11 '18 at 1:00
  • @barbarabeeton there is something similar if you instead use \notag inside equation, that should of course be altered to no \notag and using equation*. Thst one have stumped me on a few manuscript edits. Might note that one too – daleif Apr 11 '18 at 6:04

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.