3

I'm having some problems with my List Of Figures.

I have a couple subfigures in my report, and when I go to the list of Figures, the link for the main caption works well and redirects to the right page.

But when I click on the link on one of the captions of the subfigures, I get redirected to the 1st page of my report.

Is there a way to make the link from the subfigure's caption redirect to the subfigure itself ?

Here's my code :

\documentclass{book}
\usepackage[lofdepth,lotdepth]{subfig}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=NavyBlue,citecolor=Fuchsia,linktocpage]{hyperref}
\begin{document}
\Chapter{Coucou toi}
\begin{figure}[H]
\centering
\subfloat{
\includegraphics[\textwidth]{Fig1.jpg}
\label{fig:Figure1}}
\qquad
\subfloat{
\includegraphics[width=0.6\textwidth]{Fig2.jpg}
\label{fig:Figure2}}
\caption[Blabla]{Bloblo\protect\footnotemark}
 \label{fig:Figure}
\end{figure}
\footnotetext{Source : \itshape{\url{http://www.coucou.com}}}
\noindent
\end{document}

Don't know if it helps, but when I compile I get the error : name{subfigure.3.3} has been referenced but does not exist, replaced by a fixed one"

2

1 Answer 1

1

The subfig has some known issues about working with the hyperref package, as described in subcaption vs. subfig: Best package for referencing a subfigure

Here's a version of your code that uses the subcaption package which provides the subfigure environment. The hyperlinks work as expected. Just note that you should remove the demo option from the graphicx package when you're ready for your 'live' document.

\documentclass{book}
\usepackage[demo]{graphicx}
\usepackage[list=true]{subcaption}
\usepackage[colorlinks=true,
                        linkcolor=blue,
                        urlcolor=blue,
                        citecolor=purple,
                        linktocpage]{hyperref}


\begin{document}

\listoffigures

\chapter{My chapter}

\begin{figure}[p]
    \centering
    \begin{subfigure}{\textwidth}
        \includegraphics[width=\textwidth]{Fig1}
        \caption{}
        \label{fig:Figure1}
    \end{subfigure}
    \qquad
    \begin{subfigure}{.6\textwidth}
        \includegraphics[width=\textwidth]{Fig2}
        \caption{}
        \label{fig:Figure2}
    \end{subfigure}
    \caption[Blabla]{Bloblo\protect\footnotemark}
    \label{fig:Figure}
\end{figure}

\footnotetext{Source : \itshape{\url{http://www.coucou.com}}}

\end{document}

You must log in to answer this question.

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