0

It seems that using \label inside \subbottom causes known problems inside the 'memoir' class of documents.

Although I already solved the problem, I was stumped by the fact that I cannot reproduce one of the solutions here in TEX: https://tex.stackexchange.com/a/303156/107951

\documentclass{memoir}

\usepackage{graphicx}
\usepackage{hyperref}
\newsubfloat{figure}

\begin{document}

\begin{figure}[h]
  \subbottom[Image A]{\includegraphics[width=0.5\columnwidth]{example-image-a}}
  \caption{First}
\end{figure}

\begin{figure}
  \subbottom[Image B]{\includegraphics[width=0.5\columnwidth]{example-image-b}}
  \caption{Second}
\end{figure}

\end{document}

I copied it verbatim and compiled it, and keep getting the warning: "pdfTex warning (ext4): destination with the same identifier (name{subfigure.1}) has been already used, duplicate ignored"

I'm using TEXnicCenter 2.02 (64 bits) and basic-miktex-2.9.5997 (64 bits).

The error occurs independently of the order of \usepackage{hyperref} and \newsubfloat{figure} (i.e., both the original question and the solution in Hyperref: destination with the same identifier (...) has been already used, duplicate ignored lead to the same error):

enter image description here

enter image description here

Log: http://textuploader.com/53jkc

  • 2
    The linked example works for me out of the box. Please show us your document rather –  Jun 20 '16 at 13:28
  • @ChristianHupfer Do you mean include the code in the question, attach the .tex file or attach the .pdf? – AFS Rodrigues Jun 20 '16 at 13:35
  • 1
    Update your question by pasting the code of minimal example into it. You cannot attach files. – daleif Jun 20 '16 at 13:37
  • @ChristianHupfer I am literally using the code in the link, is it not a minimal working example? – AFS Rodrigues Jun 20 '16 at 13:41
  • Where are you placing the label? It should go in side the [...] option. And please update your example, there are no labels or references here, so this example cannot give you the warning you mention. – daleif Jun 20 '16 at 13:47
  • @ChristianHupfer You are right, it doesn't even have the \label, but I still get the warning (I added a picture). So the problem is apparently not the label. – AFS Rodrigues Jun 20 '16 at 13:59
  • Have you tried deleting the aux files and recompiled. I get no errors or warnings with your MWE – daleif Jun 20 '16 at 14:00
  • @ChristianHupfer Yes, I just copied the .tex file to a new folder and ran it to be sure before posting the error. This is not super important, since I have a solution to the original problem I am having, but it requires me using the subcaption package, which I wanted to avoid. Don't loose sleep over it :) – AFS Rodrigues Jun 20 '16 at 14:06
  • @AFSRodrigues: Do you have realized that daleif was making a lot of comments, not me? ;-) –  Jun 20 '16 at 16:10
  • @ChristianHupfer Duh... Sorry for the spam, I really didn't notice. – AFS Rodrigues Jun 20 '16 at 16:40

1 Answers1

1

In your example code you have \newsubfloat{figure} behind \usepackage{hyperref}. This is correct and compile without warnings.

But in your screenshot you have \newsubfloat{figure} before \usepackage{hyperref}, and this leads to the warning as now hyperref can't patch the subfloat.

Ulrike Fischer
  • 327,261
  • Sorry, I was trying both the question and the solution to see the difference and posted the wrong one. But the warning persists. I've updated the question with both images. – AFS Rodrigues Jun 20 '16 at 14:31
  • Show the complete log-file of the compilation of the example with the \newsubfloat behind hyperref. – Ulrike Fischer Jun 20 '16 at 14:44
  • Here it is http://textuploader.com/53jkc – AFS Rodrigues Jun 20 '16 at 14:56
  • I can not reproduce the warning, but your system is older than mine. It is rather curious that your memoir is from 2015 but your hobsub-generic version is older than the one in texlive 2014. – Ulrike Fischer Jun 20 '16 at 15:30
  • Ok, no problem. As I said in the question, I've solved the problem through other means, it was just strange that a verbatim copy of the solution in that thread kept giving the warning. Thanks for looking into it. – AFS Rodrigues Jun 20 '16 at 16:04