3

Minimal example:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{hyperref}
\usepackage{subcaption}

\begin{document}
\listoffigures
\clearpage

\begin{figure}[]
  \begin{subfigure}{\textwidth}
  \includegraphics{something}
  \end{subfigure}
\end{figure}
\clearpage
\begin{figure}[]
  \ContinuedFloat
  \begin{subfigure}{\textwidth}
  \includegraphics{something}
  \end{subfigure}
  \caption{Wrong page number and wrong hyperref in LOF}
\end{figure}

\end{document}

This results in the list of figures (LOF) linking to the second figure. Also the page number is set to the page of the second figure.

What I'd like to achieve is that page number and hyperref are set by the first figure. Because as \ContinuedFloat indicates: The second figure is just a continuation of the first one (in my real case the first one fills up the page so I need a second figure). And thus I also don't want to have a caption beneath the first figure.

How can I do this?

1 Answer 1

3

You need \captionsetup{list=off} for the continued figure and \captionsetup{labelformat=empty} for the first. Also the label of the first figure goes into the optional argument, so that it appears only in LOF

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{hyperref}
\usepackage{subcaption}


\begin{document}
\listoffigures
\clearpage

\begin{figure}[]
  \begin{subfigure}{\textwidth}
  \includegraphics{something}
  \end{subfigure}
  \captionsetup{labelformat=empty}
  \caption[this goes into LOF]{}
\end{figure}
\clearpage
\begin{figure}[]
  \ContinuedFloat
  \captionsetup{list=off}
  \begin{subfigure}{\textwidth}
  \includegraphics{something}
  \end{subfigure}
  \caption{Wrong page number and wrong hyperref in LOF}
\end{figure}

\end{document}

LOF:

enter image description here

First image (no caption):

enter image description here

Second image (caption):

enter image description here

2
  • Yeah, you're my hero ;) One question left: Is there a difference between using \captionsetup{list=off}\caption{text} and \caption[]{text}?
    – Robsdedude
    Commented Aug 21, 2016 at 18:05
  • 2
    \captionsetup may be more convenient if it affects multiple figures. Otherwise it's the same.
    – d-cmst
    Commented Aug 21, 2016 at 18:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .