我有以下代码:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption,subcaption}
\begin{document}
\begin{figure}
\vspace*{\fill}
\centering
\includegraphics[width=120mm]{image1}
\subcaption{Lorem1}
\label{asd:a}\par\vspace{5mm}
\includegraphics[width=120mm]{image1}
\subcaption{Lorem2}
\label{asd:b}\par\vspace{5mm}
\includegraphics[width=120mm]{image1}
\subcaption{Lorem3}
\label{asd:c}\par\vspace{5mm}
\caption{ASD}
\label{asd}
\end{figure}
\end{document}
我得到以下输出:
代码提供带有“ASD”子标题的输出。但是,我想将其作为表单中的标题获取Figure xx
。我该怎么做?
答案1
看看包装文档(第 4 页)揭示:
请注意 \subcaption 命令必须在其自己的框或环境内应用。
因此,按照文档中的示例:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption,subcaption}
\begin{document}
\begin{figure}
\vspace*{\fill}
\centering
\begin{minipage}{\textwidth}
\includegraphics[width=120mm]{image1}
\subcaption{Lorem1}
\label{asd:a}
\end{minipage}\par\vspace{5mm}
\begin{minipage}{\textwidth}
\includegraphics[width=120mm]{image1}
\subcaption{Lorem2}
\label{asd:b}
\end{minipage}\par\vspace{5mm}
\begin{minipage}{\textwidth}
\includegraphics[width=120mm]{image1}
\subcaption{Lorem3}
\label{asd:c}
\end{minipage}\par\vspace{5mm}
\caption{ASD}
\label{asd}
\end{figure}
\end{document}
或者使用subfigure
提供的环境:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption,subcaption}
\begin{document}
\begin{figure}
\vspace*{\fill}
\centering
\begin{subfigure}{\textwidth}
\includegraphics[width=120mm]{image1}
\caption{Lorem1}
\label{asd:a}
\end{subfigure}\par\vspace{5mm}
\begin{subfigure}{\textwidth}
\includegraphics[width=120mm]{image1}
\caption{Lorem2}
\label{asd:b}
\end{subfigure}\par\vspace{5mm}
\begin{subfigure}{\textwidth}
\includegraphics[width=120mm]{image1}
\caption{Lorem3}
\label{asd:c}
\end{subfigure}\par\vspace{5mm}
\caption{ASD}
\label{asd}
\end{figure}
\end{document}