我使用了其中任何一个,都出现同样的错误。无法检查我的错误在哪里。
\documentclass[12pt,oneside]{book}
\usepackage{graphicx}
\usepackage{subfigure}
\begin{document}
\begin{figure}[h]
\centering
\begin{subfigure}{\linewidth}
\includegraphics[scale=0.4]{example-image}
\caption{test1}
\end{subfigure}
% \hfil
\begin{subfigure}{\linewidth}
\includegraphics[scale=0.4]{example-image}
\caption{test2}
\end{subfigure}
\caption{Testing}
\label{fig:Features}
\end{figure}
\结束{文档}
答案1
您似乎正在使用subcaption
包的语法,所以
\documentclass[12pt,oneside]{book}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}[h]
\centering
\begin{subfigure}{\linewidth}
\includegraphics[scale=0.4]{example-image}
\caption{test1}
\end{subfigure}
\begin{subfigure}{\linewidth}
\includegraphics[scale=0.4]{example-image}
\caption{test2}
\end{subfigure}
\caption{Testing}
\label{fig:Features}
\end{figure}
\end{document}