我有一张表格,其中的图片数量为奇数,每行放置两张。右下角没有图片,我希望图片的标题出现在那里以节省一些垂直空间。它实际上应该是标题,这样我就可以根据需要在文本中引用该图片。
有解决办法吗?
例子:
\begin{figure}
\centering
\begin{tabular}{cc}
\includegraphics[scale=0.5]{Figures/test}
&
\includegraphics[scale=0.5]{Figures/test}
\\
\includegraphics[scale=0.5]{Figures/test}
&
PUT FIGURE WITH CAPTION HERE (to be referred)
\end{tabular}
\end{figure}
答案1
您可以使用列类型p
,m
或b
。m
和b
需要包裹array
,这对于将图像置于列的中心也很有用:
\documentclass{article}
\usepackage{graphicx}
\usepackage{array}
\usepackage{calc}
\begin{document}
\begin{figure}
\centering
\begin{tabular}{*2{>{\centering\arraybackslash}b{.5\textwidth-2\tabcolsep}}}
\includegraphics[scale=0.5]{example-image-a}
&
\includegraphics[scale=0.5]{example-image-b}
\\
\includegraphics[scale=0.5]{example-image-c}
&
\caption{PUT FIGURE WITH CAPTION HERE (to be referred)}
\end{tabular}
\end{figure}
\end{document}
这三种列类型仅在垂直对齐方面有所不同。有时使用包裹adjustbox
也可能有用:
\documentclass{article}
\usepackage{graphicx}
\usepackage{array}
\usepackage{calc}
\usepackage{adjustbox}
\begin{document}
\begin{figure}
\centering
\begin{tabular}{*2{>{\centering\arraybackslash}p{.5\textwidth-2\tabcolsep}}}
\includegraphics[scale=0.5]{example-image-a}
&
\includegraphics[scale=0.5]{example-image-b}
\\
\adjincludegraphics[scale=0.5,valign=T]{example-image-c}
&
\caption{PUT FIGURE WITH CAPTION HERE (to be referred)}
\end{tabular}
\end{figure}
\end{document}