7

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.

11

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}

enter image description here

2
  • 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) – user2574 Jan 6 '13 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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