I am using the subfig package. I have noticed that the links from the table of contents to subfigures always take me to page 1, instead of taking me to the right page in the document.
Here is an example:
Code: Select all
\documentclass{book}
\usepackage[pdftex]{hyperref}
\usepackage{subfig}
\makeindex
\begin{document}
\tableofcontents
\setcounter{lofdepth}{2}
\listoffigures
\chapter{This is Chapter 1}
This is a reference to figure \ref{fig:test1}.
\newpage
\begin{figure}[!ht]
\centering
\begin{picture}(10,10)
\put(0,0){\line(1,1){10}}
\end{picture}
\caption{Testfigures}
\label{fig:test1}
\end{figure}
\chapter{This is Chapter 2}
This is a reference to figure \ref{fig:test2} with subfigures \ref{fig:testsub1} and \ref{fig:testsub2}.
\newpage
\begin{figure}[!ht]
\centering
\unitlength .5cm
\subfloat[SubFig1]
{\label{fig:testsub1}
\begin{picture}(10,10)
\put(0,0){\line(1,1){10}}
\end{picture}
}
\qquad
\subfloat[SubFig2]
{\label{fig:testsub2}
\begin{picture}(10,10)
\put(0,10){\line(1,-1){10}}
\end{picture}
}
\caption{Testfigures}
\label{fig:test2}
\end{figure}
\end{document}
1. that the links from a reference within the text to the subfigure work fine
2. that this issue only occurs with the book/report classes
Does anybody know how to fix this or a workaround?
Many thanks!
Laura