\documentclass{article}
\usepackage{tikz}
\usepackage[tight,footnotesize]{subfigure}
%\usepackage{subcaption}
\begin{document}
\begin{figure}[ht]
\begin{subfigure}{0.5\linewidth}
\centering
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0)
{\includegraphics[width=\textwidth]{Speed_torque_healthyandfaulty.eps}};
\node[anchor=south west,inner sep=0] (image) at (3.7,1.5)
{\includegraphics[width=0.36\textwidth]{Speed_torque_healthyandfaulty_zoomed.eps}};
\end{tikzpicture}
\caption{torque}
\end{subfigure}
%
\begin{subfigure}{0.5\linewidth}
\centering
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0)
{\includegraphics[width=0.96\textwidth]{Speed_healthyandfaulty.eps}};
\node[anchor=south west,inner sep=0] (image) at (1.8,1.5)
{\includegraphics[width=0.4\textwidth]{Speed_healthyandfaulty_zoomed.eps}}; \end{tikzpicture} \caption{torque!}
\end{subfigure}
\caption{figures}
\end{figure}
\end{document}
答案1
正如评论中已经提到的:
subfigure
是过时的软件包。不要使用它!它已被替换为软件包\subfig
。subfigure
由包定义的环境subfigure
与由包定义的同名环境没有任何共同之处subcaption
subfig
包定义环境subloat
,其语法如下:
\subfloat[<options>][< sub caption>]{sub figure file name}
subcaption
包是更强大/灵活的包,例如更好地支持hyperef
引用等。既然您已经使用它,我看不出有任何理由放弃一个好的解决方案。
无论如何,使用subfig
包,你的 MWE 可以是:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{tikz}
\usepackage{subfig} % <---
\begin{document}
\begin{figure}[ht]
\subfloat[torque]% <---
{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0)
{\includegraphics[width=0.5\textwidth]{Speed_torque_healthyandfaulty.eps}};
\node[anchor=south west,inner sep=0] (image) at (3.7,1.5)
{\includegraphics[width=0.18\textwidth]{Speed_torque_healthyandfaulty_zoomed.eps}};
\end{tikzpicture}
}
\hfill
\subfloat[torque!]% <---
{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0)
{\includegraphics[width=0.48\textwidth]{Speed_healthyandfaulty.eps}};
\node[anchor=south west,inner sep=0] (image) at (1.8,1.5)
{\includegraphics[width=0.2\textwidth]{Speed_healthyandfaulty_zoomed.eps}};
\end{tikzpicture}
}
\caption{figures}
\end{figure}
\end{document}