0

This is more of a bug report than a question.

When using memoir's subcaptions (not the subcaption package) and links with the hyperref package, references to subfigures always point to the first instance of that label. Here's a minimal example:

\documentclass{memoir}
\newsubfloat{figure}

\usepackage[demo]{graphicx} \usepackage{hyperref}

\begin{document} \begin{figure} \subbottom[foo\label{foo}]{\includegraphics{figure1}} \subbottom[bar\label{bar}]{\includegraphics{figure2}} \caption{\subcaptionref{foo} foo and \subcaptionref{bar} bar.} \end{figure}

\begin{figure} \subbottom[qux\label{qux}]{\includegraphics{figure3}} \subbottom[baz\label{baz}]{\includegraphics{figure4}} \caption{\subcaptionref{qux} qux and \subcaptionref{baz} baz.} \end{figure} \end{document}

The subcaptionref on the second figure ((a) qux and (b) baz) will link to the sub figures with the same labels on the first figure ((a) foo and (b) bar). Here's someone else on the internet with the same problem.

I've found that I can work around this by declaring the sub figures after loading the hyperref package, i.e.:

\usepackage{hyperref}
\newsubfloat{figure} % this line was moved to after \usepackage{hyperref}

But I would guess that this is something that should be fixed on hyperref or memoir (or documented in one of them).

  • Personally I don't think there is something to fix. Loading hyperref after (nearly) all other packages so it can patch them, and applying the (patched) commands afterwards is the standard way hyperref has to be handled. Same with \newfloat offered by float etc. See also: http://www.texfaq.org/FAQ-hyperdupdest So using \newsubfloat after hyperref is not a work-around, instead it's how it should be. –  Jan 11 '21 at 19:50

0 Answers0