![编号几个乳胶数字](https://linux22.com/image/251795/%E7%BC%96%E5%8F%B7%E5%87%A0%E4%B8%AA%E4%B9%B3%E8%83%B6%E6%95%B0%E5%AD%97.png)
如何在乳胶中包含图形标签?标签的意思是,如果我导入多个图形:
\begin{figure}[ht]
\centering
\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure1.pdf}
\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure2.pdf}
\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure3.pdf}
\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure4.pdf}
\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure5.pdf}
\end{figure}
我该如何对这些图形进行编号,比如将第一个图形编号为(a),将第二个图形编号为(b),等等...我希望这些图形显示在每个图形外面的左上角,然后可以在标题中引用它们。
答案1
你需要subfig
或者包subcaption
。下面是使用该包的示例subfig
:
\documentclass{article}
\usepackage{subfig}
\begin{document}
\begin{figure}
\centering
\subfloat[caption of the subfigure]{\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure1.pdf}\label{fig:subfig-a}}\\
\subfloat[caption of the subfigure]{\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure2.pdf}}\\
\subfloat[caption of the subfigure]{\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure3.pdf}}\\
\subfloat[caption of the subfigure]{\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure4.pdf}}...
\caption{caption of the whole figure}\label{fig:whole}
\end{figure}
The whole figure is~\label{fig:whole} and the first subfigure is~\label{fig:subfig-a}.
\end{document}
看subcaption 与 subfig:引用子图的最佳包了解两个软件包之间的差异
答案2
最简单的方法是将所有内容放入如下结构中:
\begin{figure}[ht]
\begin{tabular}{c}
\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure1.pdf}\\
(a) Your label of choice\\
\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure2.pdf}\\
(b) Your label of choice\\
\end{tabular}
\bigskip
\caption{Your caption}
\end{figure}
这是我在一份报告中所做的,结果很好。 \bigskip 用于在表格最后一行和标题之间添加一些空格。