![如何在表格内为图像添加标题](https://linux22.com/image/458500/%E5%A6%82%E4%BD%95%E5%9C%A8%E8%A1%A8%E6%A0%BC%E5%86%85%E4%B8%BA%E5%9B%BE%E5%83%8F%E6%B7%BB%E5%8A%A0%E6%A0%87%E9%A2%98.png)
\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
如果您需要更多功能。
我使用\parbox
es 而不是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}