![“没有定义计数器‘subfigure@save’”。使用 subfloat 命令时会出现此错误](https://linux22.com/image/379169/%E2%80%9C%E6%B2%A1%E6%9C%89%E5%AE%9A%E4%B9%89%E8%AE%A1%E6%95%B0%E5%99%A8%E2%80%98subfigure%40save%E2%80%99%E2%80%9D%E3%80%82%E4%BD%BF%E7%94%A8%20subfloat%20%E5%91%BD%E4%BB%A4%E6%97%B6%E4%BC%9A%E5%87%BA%E7%8E%B0%E6%AD%A4%E9%94%99%E8%AF%AF.png)
当我使用 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}