在图片和编号之间添加垂直空格

在图片和编号之间添加垂直空格

我有以下 MWE:

\documentclass[a4paper,10pt]{article}
\usepackage{graphicx}
\usepackage{subfig}

\makeatletter
\newbox\sf@box
\newenvironment{SubFloat}[2][]%
{\def\sf@one{#1}%
\def\sf@two{#2}%
\setbox\sf@box\hbox
\bgroup}%
{ \egroup
\ifx\@empty\sf@two\@empty\relax
\def\sf@two{\@empty}
\fi
\ifx\@empty\sf@one\@empty\relax
\subfloat[\sf@two]{\box\sf@box}%
\else
\subfloat[\sf@one][\sf@two]{\box\sf@box}%
\fi}
\makeatother


\begin{document}

\begin{figure}[!ht]
\centering
% \captionsetup[subfigure]{labelformat=empty} % Removes a), b) labels
%
\begin{SubFloat}
{\label{fig:1} }
\includegraphics[width=0.42\textwidth]{fig.png}%
\end{SubFloat}
\vspace{1cm}
\qquad
\begin{SubFloat}
{\label{fig:2} }
\includegraphics[width=0.42\textwidth]{fig.png}%
\end{SubFloat}

\begin{SubFloat}
{\label{fig:3} }
\includegraphics[width=0.42\textwidth]{fig.png}%
\end{SubFloat}
\qquad
\begin{SubFloat}
{\label{fig:4} }
\includegraphics[width=0.42\textwidth]{fig.png}%
\end{SubFloat}

\caption{Caption blah blah.}
\label{figure-temp}
\end{figure}

\end{document}

这给了我这个:

输出

我需要某种方法在每个图的标题(“X 轴”)和分配给它的字母(a、b、c、d)之间添加垂直空间。不是整个文章,而是特定于这个图。干杯!

答案1

captionskip在环境中设置密钥figure

\begin{figure}[!htp]
\centering
\captionsetup[subfigure]{captionskip=20pt} % adjust the value
%
\begin{SubFloat}
...
\end{Subfloat}

\caption{Caption blah blah.}
\label{figure-temp}
\end{figure}

使用[!ht]这么大的浮点数必然会带来麻烦,最好[!htp]

相关内容