# subcaption in LOF with hyperref

MWE:

\documentclass{article}
\usepackage{subcaption}
\usepackage{hyperref}

\begin{document}
\listoffigures

\begin{figure}
\begin{subfigure}[b]{.5\linewidth}
\centering\large A
\caption{A subfigure}\label{fig:1a}
\end{subfigure}%
\begin{subfigure}[b]{.5\linewidth}
\centering\large B
\caption{Another subfigure}\label{fig:1b}
\end{subfigure}
\caption{A figure}\label{fig:1}
\end{figure}

\end{document}


I have this MWE, but I would like to add the subfigures in the LOF with their correct links. I have tried with subfigure and subfig packages, but there are some incompatibilities. Any idea is welcome.

-

Just add list=on to the subcaption package options, e.g.:

\documentclass{article}
%\usepackage{tocloft}
%\setcounter{lofdepth}{2} % tocloft needs increasing the counter lofdepth additionally
%\setcounter{lotdepth}{2} % same for LoT
\usepackage[list=on]{subcaption}
\usepackage{hyperref}

\begin{document}
\listoffigures

\begin{figure}
\begin{subfigure}[b]{.5\linewidth}
\centering\large A
\caption{A subfigure}\label{fig:1a}
\end{subfigure}%
\begin{subfigure}[b]{.5\linewidth}
\centering\large B
\caption{Another subfigure}\label{fig:1b}
\end{subfigure}
\caption{A figure}\label{fig:1}
\end{figure}

\end{document}


-
Thanks! But there is a problem if you add the tocloft package the the list option doesn't work. Do you know if this is an incompatibility? – Gitano Jan 6 '13 at 2:51
The tocloft package has its very own mechanism for filtering the LOF level, the lofdepth counter. So when loading the tocloft package one has to increase this counter via \setcounter{lofdepth}{2} additionally after loading the tocloft package. (Same for LOT, the related counter is lotdepth here) – Axel Sommerfeldt Jan 6 '13 at 7:53
Thanks! everything works perfect! – Gitano Jan 6 '13 at 13:51