![如何减少图形之间的水平和垂直空间?](https://linux22.com/image/299566/%E5%A6%82%E4%BD%95%E5%87%8F%E5%B0%91%E5%9B%BE%E5%BD%A2%E4%B9%8B%E9%97%B4%E7%9A%84%E6%B0%B4%E5%B9%B3%E5%92%8C%E5%9E%82%E7%9B%B4%E7%A9%BA%E9%97%B4%EF%BC%9F.png)
我想插入 24 个数字,每两个并排。我正在这样做,\minipage
但我对结果并不满意,因为虽然数字看起来很小,但一页中只能有 4 个,这占用了很多空间。我对每两个数字重复这一部分,我得到了输出,但效果不太好,我想减少它们之间的水平和垂直空间。我将不胜感激任何建议。
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{floats}
\begin{document}
\begin{figure}[h!]
\centering
\begin{minipage}{.45\textwidth}
\captionsetup{type=figure}
\centering
\includegraphics[width=\linewidth]{figures/22.pdf}
\end{minipage}
\begin{minipage}{.45\textwidth}
\captionsetup{type=figure}
\centering
\includegraphics[width=\linewidth]{figures/T22.pdf}
\end{minipage}
\caption*{$H=1$}
\end{figure}
\end{document}
答案1
您的示例中的minipage
没有任何用处,而且您似乎也不想要浮动图形,所以我不会使用figure
。如果您需要 captionscaption
包提供的内容\captionof{figure}{...}
,但要将 24 张图片放在一起,您可以使用
{\centering
\includegraphics[width=.25\textwidth]{fig01}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig02}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig03}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig04}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig05}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig06}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig07}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig08}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig09}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig10}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig11}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig12}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig13}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig14}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig15}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig16}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig17}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig18}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig19}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig20}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig21}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig22}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig23}\linebreak[0]%
\includegraphics[width=.25\textwidth]{fig24}\linebreak[0]%
}
这将使行列分为 6 行,每行 4 行,行与\lineskip
行之间没有水平间距,行与行之间有粘连。当然,可以调整图像宽度和/或添加间距,而不是增加换行惩罚。