当我使用 nex 代码时显示以下错误
***“LaTeX 错误:未定义计数器‘subfigure@save’。请参阅 LaTeX 手册或 LaTeX Companion 了解解释。输入 H 可立即获得帮助。...
l.24 \subfloat [BT 分岔图]{\includegraphics[width=0.38\textwid..."***
我正在使用的代码是这样的:
\documentclass[draft]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{multirow}
\usepackage{fancyhdr}
\usepackage{epic}
\usepackage{eepic}
\usepackage{amsmath}
\usepackage{threeparttable}
\usepackage{amscd}
\usepackage{here}
\usepackage{graphicx}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{subfigure}
\usepackage{longtable}
\usepackage{comment}
\usepackage{subfig}
%para graficas
\begin{document}
\begin{figure}[!tbp]
\centering
\subfloat[BT bifurcation diagram]{\includegraphics[width=0.38\textwidth]{ZTauEquilibrio.eps}\label{fig:f1}}
\hfill
\subfloat[Divergence in non-equilibrium region for the point $\tau=-0.06$ y $\rho=0.001$]{\includegraphics[width=0.6\textwidth]{ZTauEquilibrio.eps}\label{fig:f2}}
\end{figure}
\end{document}
我该如何修复它?
答案1
该subfig
包替换了旧subfigure
包 - 请不要同时使用它们:
\documentclass[draft]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{multirow}
\usepackage{fancyhdr}
\usepackage{epic}
\usepackage{eepic}
\usepackage{amsmath}
\usepackage{threeparttable}
\usepackage{amscd}
\usepackage{here}
\usepackage{graphicx}
\usepackage{lscape}
\usepackage{tabularx}
%\usepackage{subfigure}
\usepackage{longtable}
\usepackage{comment}
\usepackage{subfig}
%para graficas
\begin{document}
\begin{figure}[!tbp]
\centering
\subfloat[BT bifurcation diagram]{\includegraphics[width=0.38\textwidth]{example-image}\label{fig:f1}}
\hfill
\subfloat[Divergence in non-equilibrium region for the point $\tau=-0.06$ y $\rho=0.001$]{\includegraphics[width=0.6\textwidth]{example-image}\label{fig:f2}}
\end{figure}
\end{document}
答案2
最好使用 subcaption 包
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Picture 1}
\label{fig:1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Picture 2}
\label{fig:2}
\end{subfigure}
\end{figure}
\end{document}