0

I am currently working on my thesis. I struggle hard to get a figure to look like I want it to be. I do have a Figure with nested subfigures/subcaptions. I need a custom numbering for the captions, since the automatic counter increase does not handle the structure as I want it. My research made me do custimized captions using \renewcommand\thesubfigure{\Roman{subfigure}} and \addtocounter{subfigure}{-1} however if I call either one of these commands it enlarges the spacing between the subfigures and the captions. I tried to manually control the spaces, using commands like \subfigtopskip, \subfigcapskip and \subfigbottomskip. However none of it did the job.

I have a minimal example which contains two figures showing the issue. The first figure has the desired caption numbers, however the spaces are too big. The second has the right spacing but the caption numbers are not right. I would like to see a figure with the numbers of 1 and the spacing of 2. Can anyone think of an easy way to get the desired design in place.

Thank you and happy Easter

\documentclass[10pt,twocolumn]{article} 

\usepackage{graphicx}
\usepackage[]{caption}
\usepackage[]{subcaption}

\begin{document}

\begin{figure}[htb]
    \centering
    \begin{subfigure}[t]{\columnwidth}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            \renewcommand\thesubfigure{\Roman{subfigure}:a}
            \subcaption{explanation1}
        \end{subfigure}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            \renewcommand\thesubfigure{\Roman{subfigure}b}
            \addtocounter{subfigure}{-1}
            \subcaption{explanation2}
        \end{subfigure}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            \renewcommand\thesubfigure{\Roman{subfigure}c}
            \addtocounter{subfigure}{-1}
            \subcaption{explanation3}
        \end{subfigure}
        \renewcommand\thesubfigure{\Roman{subfigure}}
        \addtocounter{subfigure}{-1}
        \subcaption{example 1}\label{fig:semEx1}
    \end{subfigure}
    \vspace{1pt}
    \hrule
    \vspace{5pt}
    \begin{subfigure}[t]{\columnwidth}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            \renewcommand\thesubfigure{\Roman{subfigure}a}
            \subcaption{explanation1}
        \end{subfigure}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            \renewcommand\thesubfigure{\Roman{subfigure}b}
            \addtocounter{subfigure}{-1}
            \subcaption{explanation2}
        \end{subfigure}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            \renewcommand\thesubfigure{\Roman{subfigure}c}
            \addtocounter{subfigure}{-1}
            \subcaption{explanation3}
        \end{subfigure}
        \renewcommand\thesubfigure{\Roman{subfigure}}
        \addtocounter{subfigure}{-1}
        \subcaption{example 2}\label{fig:semEx2}
    \end{subfigure}
    \caption{Figure Caption Text. Stuff. More Stuff}\label{fig:OtsuSeg}
\end{figure}

%\subfigtopskip,\subfigcapskip, and\subfigbottomskip, \def\thesubfigure{\Roman{subfigure}b}

\begin{figure}[b]
    \centering
    \begin{subfigure}[t]{\columnwidth}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            %\renewcommand\thesubfigure{\Roman{subfigure}:a}
            \subcaption{explanation1}
        \end{subfigure}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            %\renewcommand\thesubfigure{\Roman{subfigure}c}
            %\addtocounter{subfigure}{-1}
            \subcaption{explanation2}
        \end{subfigure}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            %\renewcommand\thesubfigure{\Roman{subfigure}c}
            %\addtocounter{subfigure}{-1}
            \subcaption{explanation3}
        \end{subfigure}
        \renewcommand\thesubfigure{\Roman{subfigure}}
        \addtocounter{subfigure}{-1}
        \subcaption{example 1}\label{fig:semEx1}
    \end{subfigure}
    \vspace{1pt}
    \hrule
    \vspace{5pt}
    \begin{subfigure}[t]{\columnwidth}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            %\renewcommand\thesubfigure{\Roman{subfigure}a}
            \subcaption{explanation1}
        \end{subfigure}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            %\renewcommand\thesubfigure{\Roman{subfigure}b}
            %\addtocounter{subfigure}{-1}
            \subcaption{explanation2}
        \end{subfigure}
        \begin{subfigure}[t]{0.32\columnwidth}
            \includegraphics[width=\textwidth]{example-image}
            %\renewcommand\thesubfigure{\Roman{subfigure}c}
            %\addtocounter{subfigure}{-1}
            \subcaption{explanation3}
        \end{subfigure}
        \renewcommand\thesubfigure{\Roman{subfigure}}
        \addtocounter{subfigure}{-1}
        \subcaption{example 2}\label{fig:semEx2}
    \end{subfigure}
    \caption{Figure Caption Text. Stuff. More Stuff}\label{fig:OtsuSeg}
\end{figure}

\end{document}
Zarko
  • 296,517

0 Answers0