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.

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.

share|improve this question

1 Answer 1

up vote 10 down vote accepted

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

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

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.