答案1
让我重复一下以上评论。
\documentclass{article}
\usepackage[export]{adjustbox}
\begin{document}
\begin{figure}
\centering
\begingroup
\newcommand{\InclGr}[1]{\includegraphics[width=2cm,height=2cm,valign=t]{#1}}%
\begin{tabular}{c@{~}*3{@{}c}}
A & \InclGr{example-image-duck} & \InclGr{example-image-duck} & \InclGr{example-image-duck}\\
B & \InclGr{example-image-duck} & \InclGr{example-image-duck} & \InclGr{example-image-duck}\\
C & \InclGr{example-image-duck} & \InclGr{example-image-duck} & \InclGr{example-image-duck}\\
\end{tabular}\endgroup
\end{figure}
\end{document}
答案2
你不需要任何特殊的东西:
\documentclass{article}
\usepackage[export]{adjustbox} % also loads graphicx
\begin{document}
\begin{figure}[htp]
\centering
\makebox[1em][l]{A}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\hspace{1pt}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\hspace{1pt}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\\
\makebox[1em][l]{B}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\hspace{1pt}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\hspace{1pt}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\\
\makebox[1em][l]{C}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\hspace{1pt}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\hspace{1pt}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}
\caption{The global caption\label{label}}
\end{figure}
\end{document}
诀窍是valign=t
,获得相对于字母的顶部对齐。
为什么1pt
?因为这是 的默认值\lineskip
。
一个可能的替代方案是,图像之间没有空格,并且图像块居中,而不考虑字母。
\documentclass{article}
\usepackage[export]{adjustbox} % also loads graphicx
\begin{document}
\begin{figure}[htp]
\centering
\setlength{\lineskip}{0pt}
\makebox[0pt][r]{\makebox[1em][l]{A}}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\\
\makebox[0pt][r]{\makebox[1em][l]{B}}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}\\
\makebox[0pt][r]{\makebox[1em][l]{C}}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}%
\includegraphics[width=0.25\textwidth,valign=t]{example-image-1x1}
\caption{The global caption\label{label}}
\end{figure}
\end{document}