[Tex/LaTex] subfigures roman numbering

floatssubfloats

I have the code:

\renewcommand{\thesubfigure}{\roman{subfigure}}

\begin{figure}[h!]
    \begin{subfigure}{.32\textwidth}
    \includegraphics[scale=.21]{figures/201.pdf}
    \caption{}
    \end{subfigure}
    \begin{subfigure}{.33\textwidth}
        \includegraphics[scale=.21]{figures/202.pdf}
        \caption{}
    \end{subfigure}
\end{figure}

\begin{figure}[h!]
    \begin{subfigure}{.32\textwidth}
        \includegraphics[scale=.21]{figures/204.pdf}
        \caption{\roman{4}}
    \end{subfigure}
\end{figure}

and I want the roman numbering to continue to the new figure subfigure? Is it possible? Now the captions of the subfigures are I, II and again I. I would like them to be I,II,III. Thanks!

Best Answer

Yes, it is possible. Insert \ContinuedFloat right after \begin{figure}[h!] of the 2nd figure (and change \caption{\roman{4}} to \caption{}), i.e.:

\documentclass{article}
\usepackage[demo]{graphicx}

\usepackage{subcaption}
\renewcommand{\thesubfigure}{\roman{subfigure}}

\begin{document}

\begin{figure}[h!]
    \begin{subfigure}{.32\textwidth}
        \includegraphics[scale=.21]{figures/201.pdf}
        \caption{}
    \end{subfigure}
    \hfill
    \begin{subfigure}{.33\textwidth}
        \includegraphics[scale=.21]{figures/202.pdf}
        \caption{}
    \end{subfigure}
\end{figure}

\begin{figure}[h!]
    \ContinuedFloat   % --- This line added
    \begin{subfigure}{.32\textwidth}
        \includegraphics[scale=.21]{figures/204.pdf}
        \caption{}
    \end{subfigure}
\end{figure}

\end{document}

See also section 3.3 "Continued floats" of the caption package documentation.

Related Question