我想将 33 个子图分成 3 组进行排列,我尝试了以下解决方案:
\documentclass[smallextended,table]{svjour3}
\begin{document}
\begin{figure}
%start first row
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\end{subfigure}
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\end{subfigure}
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
%end first row
....
%start last row...
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\end{subfigure}
\end{figure}
\end{document}
输出部分正确,确实,图形占据了三列,但是,最后一组图像绘制在文档的垂直边距之外,如图所示
我该如何修复它?
答案1
由于无法在一页上放置 33 张图片,一个简单的解决方案是使用longtable
而不是figure
。adjustbox
添加 以在一个地方设置图像尺寸。同样,创建宏\N
以在每行后添加相同的垂直空间。通过将arraystretch
值更改为大于1.0
\renewcommand\arraystretch{F} % F>1.0 causes vertical stretch
但随后改为\N
常规\\
。
showframe
在最终版本中并不重要。它通过在所有页面周围绘制框架来作为参考。
\documentclass{article}
\usepackage{graphicx}
\usepackage[Export]{adjustbox}
\usepackage{longtable}
\usepackage{showframe} % For a reference in drafts
\renewcommand\ShowFrameLinethickness{0.2pt}
\renewcommand\ShowFrameColor{\color{blue}}
\adjustboxset{width=0.28\linewidth}
\newcommand\N{\\[10pt]}
\begin{document}
\begin{longtable}{ccc}
\caption{Set of N x 3 figures} \\
\includegraphics{example-image-a}
& \includegraphics{example-image-b}
& \includegraphics{example-image-c} \N
\includegraphics{example-image-a}
& \includegraphics{example-image-b}
& \includegraphics{example-image-c} \N
\includegraphics{example-image-a}
& \includegraphics{example-image-b}
& \includegraphics{example-image-c} \N
\includegraphics{example-image-a}
& \includegraphics{example-image-b}
& \includegraphics{example-image-c} \N
\includegraphics{example-image-a}
& \includegraphics{example-image-b}
& \includegraphics{example-image-c} \N
\includegraphics{example-image-a}
& \includegraphics{example-image-b}
& \includegraphics{example-image-c} \N
\includegraphics{example-image-a}
& \includegraphics{example-image-b}
& \includegraphics{example-image-c} \N
\includegraphics{example-image-a}
& \includegraphics{example-image-b}
& \includegraphics{example-image-c} \N
\includegraphics{example-image-a}
& \includegraphics{example-image-b}
& \includegraphics{example-image-c} \N
\end{longtable}
\end{document}
答案2
longtable
作为提议的替代方案Celdor
,您可以使用tcbraster
来自tcolorbox
。
\documentclass{article}
\usepackage[most]{tcolorbox}
\begin{document}
\begin{tcbraster}[raster columns=3, blanker]
\foreach \i in {1,...,11}
{\tcbincludegraphics{example-image-a}
\tcbincludegraphics{example-image-b}
\tcbincludegraphics{example-image-c}}
\end{tcbraster}
\end{document}