调整子浮动行标题的垂直间距(子浮动行+子标题)

调整子浮动行标题的垂直间距(子浮动行+子标题)

我正在尝试调整包含多个 s 和行外\subfloatrow附加项的图中子图的子标题。\ffigbox

如何修改子图和子标题之间以及子标题和其下方子图之间的垂直间距?我希望子标题更靠近其子图,并离其下方的任何子图稍远一些。

带子标题的行中的子图

代码:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[valign=c,heightadjust=all]{floatrow}
\begin{document}
\begin{figure}
  \centering
  \captionsetup[subfloatrow]{font+={footnotesize}}%
  \floatbox{figure}{%
    \begin{subfloatrow}[2]
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
    \end{subfloatrow}

    \begin{subfloatrow}[3]
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
    \end{subfloatrow}

    \begin{subfloatrow}[3]
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
    \end{subfloatrow}

    \begin{subfloatrow}[2]
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
    \end{subfloatrow}

    \ffigbox{%
      \includegraphics[height=8em]{example-image-a}}{\subcaption*{Sub-Caption}}
  }{%
    \caption{Caption}\label{fig:label}%
  }
\end{figure}
\end{document}

Guntram 的问题类似,但两年多来一直没有得到解答。评论中的建议是放弃使用floatrow。但是,我认为这应该适用于caption/subcaption包。至少,文档是这么说的。

但是,我发现floatrow的文档一点也不容易,而且我真的无法弄清楚caption- subcaption-如何floatrow能够很好地协同工作。

答案1

控制行之间的垂直间距在文档中隐藏得很好:您必须通过 声明一个键\DeclareFloatVCode,然后要求使用 来应用它\floatsetup{rowpostcode= …}。字体大小可以通过 来更改\captionsetup[subfigure],而图形和标题之间的垂直跳跃则通过 来解决\floatsetup{captionskip= …}

这是一个(可怕的)例子:

\documentclass{article}
\usepackage[showframe, margin=25mm]{geometry}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[,heightadjust=all]{floatrow}

\DeclareFloatVCode{largevskip}%
{\vskip 20pt}
\floatsetup{captionskip=0pt,rowpostcode =largevskip, valign=c }%
\captionsetup[subfigure]{font =Large}

\begin{document}
\begin{figure}
  \centering-%
  \floatbox{figure}{%
    \begin{subfloatrow}[2]
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
    \end{subfloatrow}

    \begin{subfloatrow}[3]
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
    \end{subfloatrow}

    \begin{subfloatrow}[3]
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
    \end{subfloatrow}

    \begin{subfloatrow}[2]
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
      \ffigbox[\FBwidth]{%
        \includegraphics[height=8em]{example-image-a}}{\caption*{Sub-Caption}}
    \end{subfloatrow}

    \ffigbox{%
      \includegraphics[height=8em]{example-image-a}}{\subcaption*{Sub-Caption}}
  }{%
    \caption{Caption}\label{fig:label}%
  }
\end{figure}
\end{document} 

在此处输入图片描述

相关内容