5

Is it possible to have subfigure (a), (b), (c) [Page 1], and (c), (d) [page 2] with only one caption?

This is another question extended from subfigure in multiple page

I want to have:

[Page 1]
(a)
(b)
(c)

[Page 2]
(d)
(e)
Figure 1: Show the process

and not:

[Page 1]
(a)
(b)
(c)
Figure 1: Show the process   --> Delete this

[Page 2]
(d)
(e)
Figure 1: Show the process (con't)

enter image description here

enter image description here

My full MWE:

\documentclass{book}

\usepackage[most]{tcolorbox}

% \usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage[list=true]{subcaption}

\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}{\Huge \bfseries \sffamily}
\setcounter{lofdepth}{2}

\begin{document}
\listoffigures

\chapter{One}
\section{One}

\begin{figure}[!b]
        \centering
        \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 1}
            \label{fig:arm1}
        \end{subfigure}
    %

        \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 2}
            \label{fig:arm2}
        \end{subfigure}


            \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 3}
            \label{fig:arm2}
        \end{subfigure}
        \caption{$Q^{*}$ values for different arms}


          \end{figure}
    %

    \begin{figure}[htb]\ContinuedFloat
        \centering

        \begin{subfigure}[b]{0.6\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 4}
            \label{fig:arm3}
        \end{subfigure}
    %
        \begin{subfigure}[b]{0.6\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 5}
            \label{fig:arm4}
        \end{subfigure}
        \caption{$Q^{*}$ values for different arms}
        \label{fig:arms}
    \end{figure}


\end{document}

The reason is that so that List of Figure looks better without 2 caption.

enter image description here

2
  • 2
    Just remove caption from the first part of figure.
    – Zarko
    Commented Jan 2, 2020 at 2:38
  • @Zarko, my god, how can I so stupid!!! I had tried previously remove the first caption and also remove the \end figure.....thanks a lot for your response. It works
    – aan
    Commented Jan 2, 2020 at 2:41

2 Answers 2

3

By moving the label to the first figure and using \caption* in the second (plus some more minor corrections, see the code) I get

enter image description here

\documentclass{book}

%\usepackage[most]{tcolorbox}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage[list=true]{subcaption}

\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}{\Huge \bfseries \sffamily}
\setcounter{lofdepth}{2}

\begin{document}
\listoffigures

\chapter{One}
\section{One}

\begin{figure}[!b]
        \centering
        \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 1}
            \label{fig:arm1}
        \end{subfigure}
    %

        \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 2}
            \label{fig:arm2}
        \end{subfigure}


            \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 3}
            \label{fig:arm3}
        \end{subfigure}
        \caption{$Q^{*}$ values for different arms}
        \label{fig:arms}

          \end{figure}
    %

    \begin{figure}[htb]\ContinuedFloat
        \centering

        \begin{subfigure}[b]{0.6\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 4}
            \label{fig:arm4}
        \end{subfigure}
    %
        \begin{subfigure}[b]{0.6\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 5}
            \label{fig:arm5}
        \end{subfigure}
        \caption*{Figure~\ref{fig:arms}:~$Q^{*}$ values for different arms}
    \end{figure}


\end{document}
5
  • cat. Thanks. How can I so stupid!!!!!
    – aan
    Commented Jan 2, 2020 at 2:41
  • cat. Between, the MWE you provided seemed have 1st caption there. and also what is the meaning of \caption*{Figure~\ref{fig:arms}:~$Q^{*}$ values for different arms}?
    – aan
    Commented Jan 2, 2020 at 2:50
  • @aan Well, it shows the caption again. It thought you only want to remove it from the table of contents. You can remove it if it bothers you (but I personally would keep it, maybe with a (continued) in the end.
    – user194703
    Commented Jan 2, 2020 at 2:53
  • cat. Thanks. I got your points. Can I know (continued) should be put in first caption (first page} or in second caption (second page)?
    – aan
    Commented Jan 2, 2020 at 2:54
  • 2
    @aan It is more appropriate to put it in the second caption, I think.
    – user194703
    Commented Jan 2, 2020 at 3:12
3
  • If you like to remove caption of part two of your figure only from the list of figures, than you write it as follows:
\caption[]{$Q^{*}$ values for different arms}% caption in the second part of figure
  • if you like to also remove caption from the first part of image, just remove it (as I mentioned in my comment) and preserve the caption in the second part of the figure as it is.

In the both cases the list of figures is the same:

enter image description here

The complete code for the first case can be:

\documentclass{book}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[list=true]{subcaption}

\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}{\Huge \bfseries \sffamily}
\setcounter{lofdepth}{2}

\begin{document}
\listoffigures

\chapter{One}
\section{One}

\begin{figure}[!b]
        \centering
        \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 1}
            \label{fig:arm1}
        \end{subfigure}

        \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 2}
            \label{fig:arm2}
        \end{subfigure}

            \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 3}
            \label{fig:arm2}
        \end{subfigure}
        \caption{$Q^{*}$ values for different arms}
          \end{figure}
    \begin{figure}[ht]\ContinuedFloat
        \centering
        \begin{subfigure}[b]{0.6\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 4}
            \label{fig:arm3}
        \end{subfigure}

        \begin{subfigure}[b]{0.6\textwidth}
            \includegraphics[width=\textwidth]{example-image}
            \subcaption{$Q^{*}$ values for arm 5}
            \label{fig:arm4}
        \end{subfigure}
        \caption[]{$Q^{*}$ values for different arms (cont.).}
        \label{fig:arms}
    \end{figure}
\end{document}
2
  • thanks. This is works as well. Brillant!
    – aan
    Commented Jan 2, 2020 at 2:52
  • 1
    @aan, of course it works :-). I don't know if it is brilliant, but it is simple/correct. It use standard caption syntax (as I already explain you in my answer on one of your previous questions).
    – Zarko
    Commented Jan 2, 2020 at 3:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .