[Tex/LaTex] subfigure \autoref

hyperrefnamingsubfloats

I am trying to redefine the subfigure \autoref, but have not been successful. Below is example code for the figure. I am using the acticle documentclass and the subcaption package.

\begin{figure}[H]
  \centering
  \begin{subfigure}{.48\linewidth}\centering
    \includegraphics{figa.eps}
    \caption{atest}
    \label{a}
  \end{subfigure}\hspace{3mm}
  \begin{subfigure}{.48\linewidth}\centering
    \includegraphics{figb.eps}
    \caption{btest}
    \label{b}
  \end{subfigure}
\end{figure}

I tried to redefine the autorefs using the following

\let\orgautoref\autoref
\providecommand{\Autoref}
        {\def\figureautorefname{Figure}%
         \def\subfigureautorefname{Panel}%
         \orgautoref}
\renewcommand{\autoref}
        {\def\figureautorefname{figure}%
         \def\subfigureautorefname{panel}%
         \orgautoref}

but it did not work. How do I change the autoreference from displaying "figure 1a" to "panel a"?

Best Answer

Without seeing your .tex-File I suggest to use \usepackage{subfig}, then you can use \newcommand{\subfigureautorefname}{\figureautorefname} to make \autoref work with \subfloat. I can't recall where I got this snippet from (probably from tex.SE), but anyways; it has worked fine for me.