如何在表格内为图像添加标题

如何在表格内为图像添加标题
\documentclass[12pt,preprintnumbers,amsmath,amssymb,nofootinbib,superscriptaddress]{revtex4-1}
\begin{document}
\begin{tabular}{cc}  
\begin{tabular}{c}
\parbox{0.5\linewidth}{%  change the parbox width as appropiate
\begin{itemize}
\item Master of Physics in Physics with Theoretical Physics
\item Relevant modules: Quantum Field Theory, Gauge Field Theories, Condensed Matter, Semiconductor Nanostructures.
\item Quantum foam as a possible mechanism for quantum gravity - topological underpinning
\end{itemize}}
\end{tabular} \hspace{1.5cm}
& \begin{tabular}{c}
\centering
\includegraphics[height=6cm, width=4.5cm]{example_image} 
This is an example of a neutrino interaction
\end{tabular} 
\end{tabular}\end{document}

嗨,我想知道如何在这个例子中的图像下添加标题。当我尝试使用标题功能时,如果我将其放置在相应的表格列中,它要么不显示,要么返回错误。我试过 \captionof{figure}{text},但编译时间太长,我超时了!

答案1

使用包capt-of或者caption如果您需要更多功能。

我使用\parboxes 而不是tabular因为我认为在这种情况下它们的功能更好。

但如果必须使用表格,那么我认为使用p{...}列或\parbox在列中放置图像对于\caption工作来说是必要的。

\documentclass[12pt,preprintnumbers,amsmath,amssymb,nofootinbib,superscriptaddress]{revtex4-1}
\usepackage{graphicx}
\usepackage{capt-of}% or caption
\begin{document}
 
\noindent
\parbox{0.5\linewidth}{%  change the parbox width as appropiate
\begin{itemize}
\item Master of Physics in Physics with Theoretical Physics
\item Relevant modules: Quantum Field Theory, Gauge Field Theories, Condensed Matter, Semiconductor Nanostructures.
\item Quantum foam as a possible mechanism for quantum gravity - topological underpinning
\end{itemize}}%
\hspace{1.5cm}%
\parbox{\dimexpr 0.5\linewidth-1.5cm}{
\centering
\vspace{0pt}
\includegraphics[height=6cm, width=4.5cm]{example-image}
\captionof{figure}{This is an example of a neutrino interaction}
}
\end{document}

在此处输入图片描述

相关内容