4

I have already read some similar qustions, but the solution over there does not work if I add the 'babel' package. The thing is change the autorefname of one specific, say Figure, and I just want to change the way that it is written, say capital case. Everything is fine but if I uncomment the package babel, so the command is ignored.

\documentclass[11pt]{book}

%\usepackage[english]{babel}
\usepackage{hyperref}
\def\figureautorefname{FIGURE}

\begin{document}
\begin{figure}
\centering
\rule{1cm}{1cm}
\caption{foo}\label{fig:foo}
\end{figure}
As shown in \autoref{fig:foo}~\dots
\end{document}

probably is a easy questions, but I don't find it.

8

The manual of hyperref contains an example for this case:

Example for a redefinition if babel is used:

\usepackage[ngerman]{babel}  
\addto\extrasngerman{%  
  \def\subsectionautorefname{Unterkapitel}%  
}

In your case:

\usepackage[english]{babel}
\usepackage{hyperref}
\addto\extrasenglish{%
  \def\figureautorefname{FIGURE}%
}
  • Sorry, but it doesn't work, I have already seen the example in the manual, and it works perfectly, but changing the language as well as the command extrasngerman by captionsenglish, it does not. – Gitano Jan 22 '13 at 16:22
  • Answer fixed: \extrasenglish instead of \captionsenglish. – Heiko Oberdiek Jan 22 '13 at 16:33
1

Just found the solution somewhere else. Its is correct what the manual tells you but the redefinition have to be place directly after the import of the href package!

\usepackage[ngerman]{babel} 
\usepackage{href} 
\addto\extrasngerman{\def\subsectionautorefname{Unterkapitel}}

worked for me. Greetings

  • Welcome to TeX.SE. Did you mean to refer to the hyperref package instead of the href package? – Mico Feb 22 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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