我正在使用memoir
带有hyperref
包的类。有一次,我有几个子图:
\begin{figure}[!ht]
\centering %%% not \center
\subbottom[]{\label{fig:turtled}\includegraphics[height=4cm]{graphics/turtled.png}}
\subbottom[]{\label{fig:capsized}\includegraphics[height=4cm]{graphics/capsized.png}}
\subbottom[]{\label{fig:mast-lift}\includegraphics[height=4cm]{graphics/mast-lift.png}}
\caption{(a) A turtled vessel being brought to the capsized position. (b) A capsized vessel being brought to the upright position. (c) The assisted mast-lift technique.}
\label{fig:righting}
\end{figure}
使用subbottom
命令。然后我在代码中引用它们:
... shown in \autoref{fig:mast-lift}.
不幸的是,我收到了一条关于此问题的警告,但我似乎无法弄清楚:
Package hyperref Warning: No autoref name for `subfigure' on input line ###
有人知道如何消除这个警告吗?
答案1
只需提供缺失的定义(我抑制了原始代码中与此不相关的部分):
\documentclass{memoir}
\usepackage[demo]{graphicx}
\usepackage{hyperref}
\providecommand\subfigureautorefname{Subfigure}
\newsubfloat{figure}
\begin{document}
\begin{figure}
\centering %%% not \center
\subbottom[]{\label{fig:turtled}\includegraphics[height=4cm]{graphics/turtled.png}}
\end{figure}
\autoref{fig:turtled}
\end{document}
选项demo
只是graphicx
用黑色矩形替换实际图形;不是在实际文档中使用该选项。