Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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"

share|improve this question
1  
Welcome to TeX.sx! subfig not working with hyperref is a known issue- have a look at subcaption-vs-subfig-best-package-for-referencing-a-subfigure –  cmhughes Jan 31 '13 at 20:41
    
Thanks! And how would the application of the subcaption package would look like on the code below ? Is it compatible with the options already loaded ? –  Uneo Jan 31 '13 at 20:48
add comment

1 Answer

up vote 1 down vote accepted

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.