![减少 minipage{} 环境之间的 \vspace](https://linux22.com/image/376681/%E5%87%8F%E5%B0%91%20minipage%7B%7D%20%E7%8E%AF%E5%A2%83%E4%B9%8B%E9%97%B4%E7%9A%84%20%5Cvspace.png)
我如何控制 minipage{} 之间的 vspace,以下是 MWE,演示了两个 minipage 环境之间的额外空白。
\begin{figure}[htb]
\begin{minipage}{.5\linewidth}
\centering
\subfloat[]{\label{main:a}\includegraphics[scale=.35]{3_c.pdf}}
\end{minipage}%
\begin{minipage}{.5\linewidth}
\centering
\subfloat[]{\label{main:b}\includegraphics[scale=.35]{3_d.pdf}}
\end{minipage}\par\hspace{.005\linewidth}
\centering
\subfloat[]{\label{main:c}\includegraphics[scale=.5]{fig3cd.eps}}
\caption{\SI{500}{\nano\metre} pitch and 1:1 width ratio feature imaging: (a) Confocal microscopy image vertical lines, (b) SIM image of vertical lines; (c) Line plot of (a) (blue) and (b) (red)}
\label{fig:3}
\end{figure}
或者,以下 MWE 提供了我想要的内容,只是我不知道如何将子图标题(例如 (a) (b) 和 (c))包含到以下 MWE 子图中。
\begin{figure}[htb]
\includegraphics[width=0.48\linewidth]{3_c.pdf}
\hspace{.005\linewidth}
\includegraphics[width=0.48\linewidth]{3_d.pdf}
\\[.5\baselineskip]
% \includegraphics[width=0.48\linewidth]{example-image-a}
% \hspace{.005\linewidth}
% \includegraphics[width=0.48\linewidth]{example-image-b}
% \\[.5\baselineskip]
\includegraphics[width=8.4cm]{fig3cd.eps}
\caption{\SI{500}{\nano\metre} pitch and 1:1 width ratio feature imaging: (a) Confocal microscopy image vertical lines, (b) SIM image of vertical lines; (c) Line plot of (a) (blue) and (b) (red)}
\label{fig:3}
\end{figure}
如您所见,图形之间的白色间隙比第一个更紧凑,因为我可以控制它。如何在第一个 MWE 中实现这一点,或者如何在第二个 MWE 中包含子图标题。
答案1
通常没有空间:
\documentclass[12pt,a4paper]{article}
\usepackage{subfig}
\begin{document}
\begin{figure}[htb]
\begin{minipage}{.5\linewidth}
\centering
\subfloat[]{\label{main:a}\rule{4cm}{4cm}}
\end{minipage}%
\begin{minipage}{.5\linewidth}
\centering
\subfloat[]{\label{main:b}\rule{4cm}{4cm}}
\end{minipage}\par
\centering
\subfloat[]{\label{main:c}\rule{4cm}{4cm}}
\caption{blblb}
\label{fig:3}
\end{figure}
\end{document}
空间可能来自图形中的一些白色边框。使用一些负 \vspace 可以轻松减少空间:
\documentclass[12pt,a4paper]{article}
\usepackage{subfig,color}
\begin{document}
\begin{figure}[htb]
\begin{minipage}{.5\linewidth}
\centering
\subfloat[]{\label{main:a}\rule{4cm}{4cm}}
\end{minipage}%
\begin{minipage}{.5\linewidth}
\centering
\subfloat[]{\label{main:b}\rule{4cm}{4cm}}
\end{minipage}\par\vspace{-3\baselineskip}
\centering
\subfloat[]{\label{main:c}\textcolor{yellow}{\rule{4cm}{4cm}}}
\caption{blblb}
\label{fig:3}
\end{figure}
\end{document}