# Cannot reproduce the following solution to the problem of \ref not working for \label inside \subbottom in 'memoir'

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):

• The linked example works for me out of the box. Please show us your document rather – user31729 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
• 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

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.