如何自定义子图和标题之间的间距

如何自定义子图和标题之间的间距

我目前正在写论文。我努力让一个图看起来像我想要的那样。我确实有一个带有嵌套子图/子标题的图。我需要为标题自定义编号,因为自动计数器增加不能按照我想要的方式处理结构。我的研究让我使用和来做自定义标题,\renewcommand\thesubfigure{\Roman{subfigure}}但是如果我调用其中任何一个命令,它都会扩大子图和标题之间的间距。我尝试使用诸如、和之\addtocounter{subfigure}{-1}类的命令手动控制间距。但是这些都不起作用。\subfigtopskip\subfigcapskip\subfigbottomskip

我有一个最小示例,其中包含两个显示该问题的图表。第一个图表有所需的标题编号,但空格太大。第二个图表的间距正确,但标题编号不正确。我希望看到一个数字为 1、间距为 2 的图表。有人能想到一种简单的方法来实现所需的设计吗?

谢谢你,复活节快乐

\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}

相关内容