I'm using the subcaption
package and I would like to change the display in the List of Figures of the subfigures.
Right now, it displays as :
2.1 Caption 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
a Subcaption 1 . . . . . . . . . . . . . . . . . . . . . . . . . 6
b Subcaption 2 . . . . . . . . . . . . . . . . . . . . . . . . . 6
I'd like it to have a display as :
2.1 Caption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.a Subcaption 1 . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.b Subcaption 2 . . . . . . . . . . . . . . . . . . . . . . . . . 6
Is it possible to customize the display ?
Here's the a piece of code I'm using :
\documentclass{book}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[list=true]{subcaption}
\begin{document}
\begin{figure}[H]
\centering
\begin{subfigure}{.5\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{subfigure1.jpg}
\caption{subcaption 1}
\label{fig:sub1}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
\centering
\includegraphics[width=0.3\textwidth]{subfigure2.jpg}
\caption{subcaption 2}
\label{fig:sub2}
\end{subfigure}
\caption{Caption}
\label{fig:fig}
\end{figure}
\end{document}
Best Answer
You could use the option
listformat=...
, e.g.:If you want to have an additional dot between figure and sub-figure number, one option is creating an own list format, e.g.:
Please note that this solution will still give you references like
1.1a
as result of\ref{fig:sub1}
.To change both, the appearance of List of Figures, and the references, one better re-define
\p@subcaption
. For example:As opposite to the last solution this one will change both to
1.1.a
, i.e. having a period between figure and sub-figure part of the numbering in List of Figures and references.(For details about
listformat=
and\DeclareCaptionListFormat
please take a look at thecaption
package documentation. For details about\p@subfigure
please take a look at thesubcaption
package documentation, section "References".)