Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
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
add comment

1 Answer

up vote 6 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.