我想显示按 组织的多幅图像tabular
。这是我的代码,它演示了我想要做的事情。
\documentclass[11pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\renewcommand{\arraystretch}{0}
\begin{tabular}{@{}c@{}c@{}}
\begin{tabular}{@{}c@{}c@{}}
\includegraphics[scale=0.8]{app2.png}&\includegraphics[scale=0.8]{v2.png}\\
\includegraphics[scale=0.8]{h2.png}&\includegraphics[scale=0.8]{d2.png}\\
\end{tabular}& \includegraphics[scale=0.8]{v.png}\\
\includegraphics[scale=0.8]{h.png}&\includegraphics[scale=0.8]{d.png}\\
\end{tabular}
\caption{Result}
\end{figure}
\end{document}
但是,显示结果中存在一些奇怪的垂直空间,我不知道它为什么存在以及如何删除它。
任何帮助将非常感激!
答案1
tabular
默认锚点位于垂直中心,而 则将\includegraphics
内容的锚点设置在基线上。以下代码重现了这个问题:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\renewcommand{\arraystretch}{0}
\begin{tabular}{ c c }
\begin{tabular}{ c c }
\includegraphics[scale=0.2]{example-image-1x1} & \includegraphics[scale=0.2]{example-image-1x1} \\
\includegraphics[scale=0.2]{example-image-1x1} & \includegraphics[scale=0.2]{example-image-1x1} \\
\end{tabular} & \includegraphics[scale=0.2]{example-image-1x1}
\end{tabular}
\caption{Result}
\end{figure}
\end{document}
您要么必须修正 的锚点tabular
,要么必须修正图像的锚点:
对于前者,您可以使用可选参数强制锚点
tabular
。这适用\begin{tabular}[b]{..}
于内部/嵌套tabular
,它将在 aseline 上提供一个锚点b
,就像\includegraphics
这样做一样。或者,
adjustbox
将图像valign=c
放置\includegraphics
在中心垂直锚点处:\documentclass{article} \usepackage[export]{adjustbox} \begin{document} \begin{figure} \centering \renewcommand{\arraystretch}{0} \begin{tabular}{ c c } \begin{tabular}{ c c } \includegraphics[scale=0.2]{example-image-1x1} & \includegraphics[scale=0.2]{example-image-1x1} \\ \includegraphics[scale=0.2]{example-image-1x1} & \includegraphics[scale=0.2]{example-image-1x1} \\ \end{tabular} & \includegraphics[scale=0.2,valign=c]{example-image-1x1} \end{tabular} \caption{Result} \end{figure} \end{document}
您必须使用键值
export
选项adjustbox
才能在里面按原样使用它们\includegraphics
。