General ⇒ \autoref and \chaptername
\autoref and \chaptername
Hello,
I changed the \chaptername command for getting "Capítulo" rather than "Chapter", but when I label a chapter (by \label{chap:1}, for example) and then reference it (by \autoref{chap:1}) I get a link which says "chapter 1" and not "Capítulo 1". Anybody knows how to fix that problem?
Thank you
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
\autoref and \chaptername
there's no need to redefine \chaptername; simply load babel with the spanish option:
Code: Select all
\documentclass{book}
\usepackage[spanish]{babel}
\usepackage{hyperref}
\begin{document}
\chapter{Primer cap\'itulo}\label{cap:uno}
\autoref{cap:uno}
\end{document}
Re: \autoref and \chaptername
Nevertheless, it's not the first time I'm having this problem, and not always trying to call them "Capítulo(s)" (sometimes "Tema(s)", for example), so I still would like to know how to do it

\autoref and \chaptername
Without using babel you'll have to redefine the corresponding command and its "autoref" variant:n070161 wrote:...Nevertheless, it's not the first time I'm having this problem, and not always trying to call them "Capítulo(s)" (sometimes "Tema(s)", for example), so I still would like to know how to do it...
Code: Select all
\documentclass{book}
\usepackage{hyperref}
\renewcommand\chaptername{Tema}
\renewcommand\chapterautorefname{Tema}
\begin{document}
\chapter{Primer tema}\label{cap:uno}
\autoref{cap:uno}
\end{document}
Re: \autoref and \chaptername
that's just what I've been looking for.