8

I changed the caption of my figures running the following command (I'm using the babel package):

\addto\captionsngerman{\renewcommand{\figurename}{Abb.}}

If I use \autoref{$LABEL} to reference to the figure, however, it still shows the original figure caption, instead of "Abb. X". Do I have to renew the command for refname as well? If so, would that change anything, if I now use \ref on something else besides my figures?

Here the MWE:

\documentclass[a4paper]{IEEEtran}

\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{hyperref}

\addto\captionsngerman{\renewcommand{\figurename}{Abb.}}

\begin{document}

\autoref{fig:foobar}

\begin{figure}[htb]
    \caption{BarFooCamp}
    \label{fig:foobar}
\end{figure}

\end{document}
lockstep
  • 250,273
cherrung
  • 3,759
  • 1
    Are you referring to the \autoref macro of the hyperref package? If so, you may want to issue the command \renewcommand\figureautorefname{Abb.}. – Mico Jan 12 '13 at 17:10
  • I'm assuming that it uses the \autoref of hyperref, but inserting your code, doesn't seem to solve the problem. – cherrung Jan 12 '13 at 17:14
  • Thanks for providing this clarification. Please post an MWE (minimum working example) that shows what you've done so far in terms of trying to get the cross-reference to a figure environment be a associated with the Abb. prefix. – Mico Jan 12 '13 at 17:22
  • @Mico Just added a MWE, Gonzalo's answer, however, fixed the problem. – cherrung Jan 12 '13 at 17:30

1 Answers1

9

Add the redefinition to \extrasngerman:

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{hyperref}

\addto\captionsngerman{\renewcommand{\figurename}{Abb.}}
\addto\extrasngerman{\renewcommand\figureautorefname{Abb.}}

\begin{document}

\autoref{fig:test}
\begin{figure}
\caption{test caption}
\label{fig:test}
\end{figure}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128