# Change "chapter" to "Chapter" - How to do this using autoref? [duplicate]

I am trying to change "chapter" to "Chapter" when autoreferencing the label

I have looked for a solution and some comment in this closed question Change text in LaTeX chapter titles from "Chapter" to "chapter" suggested to use renew command

I have used "babel" as well as "renewcommand" but nothing has changed.

%% *** Add any desired options. ***
\documentclass{book}

\usepackage{siunitx}
\usepackage{nomencl}
\usepackage{amsmath}
\usepackage{nicefrac}
\usepackage{nomencl}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage[english]{babel}
\usepackage{hyperref}
\renewcommand{\chaptername}{chapter}
\begin{document}
\chapter{Before We Begin}
In \autoref{Chapter2}, we will talk about how to live a full life.
\chapter{Begin}
\label{Chapter2}
\end{document}

• As an alternative, the package cleferref package has an option for capitalization: \usepackage[capitalise,noabbrev,nameinlink]{cleveref} and \cref{Chapter2}. May 21 '17 at 22:54
• Off-topic: You shouldn't load the nomencl and amsmath packages twice. Nothing good is going to come from it.
– Mico
May 22 '17 at 8:46

The manual of the hyperref package explains how to achive this on page 17.

Edit: This answer assumes that you actually want to use the babel package. If this is not the case, just redefine \chapterautorefname at the \begin{document} hook: see Bernard’s answer for instructions on how to do this.

\documentclass{book}

% \usepackage{siunitx}
% \usepackage{nomencl}
% \usepackage{amsmath}
% \usepackage{nicefrac}
% \usepackage{nomencl}
% \usepackage{amsmath}
% \usepackage{amsthm}
% \usepackage{amssymb}
\usepackage[english]{babel}
\usepackage{hyperref}
\def\chapterautorefname{Chapter}%
}
\begin{document}
\chapter{Before We Begin}
In \autoref{Chapter2}, we will talk about how to live a full life.
\chapter{Begin}
\label{Chapter2}
Live until you die\textellipsis~:-)
\end{document}


Here’s the output I get:

Of course, the same mechanism works for other titles as well:

\documentclass{book}

\usepackage[english]{babel}
\usepackage{hyperref}
\def\chapterautorefname{Chapter}%
\def\sectionautorefname{Section}%
\def\subsectionautorefname{Subsection}%
\def\subsubsectionautorefname{Subsubsection}%
\def\paragraphautorefname{Paragraph}%
\def\subparagraphautorefname{Subparagraph}%
}
\begin{document}
\chapter{Before We Begin}
In \autoref{Chapter2}, we will talk about how to live a full life.
\chapter{Begin}
\label{Chapter2}
Live until you die\textellipsis~:-)
\end{document}


For a complete list of the available names, see the file hyperref.sty at lines, say, 3220–3235.

• Is there a way to do this for section also? Or is it what I think "\addto\extrasenglish{% \def\sectionautorefname{Section}% }" May 21 '17 at 23:34
– GuM
May 22 '17 at 6:43

Whether you use babel or not, this works (no problem if you only use the English language – otherwise @Gustavo Mezzeti's answer is more appropriate):

\documentclass[english]{book}

\usepackage{siunitx}
\usepackage{nomencl}
\usepackage{amsmath}
\usepackage{nicefrac}
\usepackage{amsthm}
\usepackage{amssymb}
%
\usepackage{babel}
\usepackage{hyperref}
\AtBeginDocument{\def\chapterautorefname{Chapter}}%

\begin{document}

\chapter{Before We Begin}
In \autoref{Chapter2}, we will talk about how to live a full life.
\chapter{Begin}
\label{Chapter2}

\end{document}

• I bet, however, that one is going to have issues if more than one language is used (not very likely, admittedly).
– GuM
May 21 '17 at 22:49
• @Gustavo Mezzetti: That was my implicit hypothesis. Should I be clearer? May 21 '17 at 22:51
• In general, I think it is a matter of mental order to keep distinct the two scenarios “babel used” vs. “babel not used”, and to give separate instructions for the two. Please note the my implicit hypothesis, in my answer, is that the OP actually wanted to use babel, and this, reading more carefully, doesn’t seem to be the case. So your answer is probably better: +1.
– GuM
May 21 '17 at 22:58
• Hi is the way to capitalize "Section" and "Subsection" done in the same way? May 21 '17 at 23:39
• Yes. See lines 3220-3235 in hyperref.sty. May 21 '17 at 23:42

I get annoyed all the time, not just for chapters, but also for sections. I also found using subsection and subsubsection in text would not be appealing, when it is possible to use Chapter 1, Section 5, Section 3.1 and Section 2.5.4.

\renewcommand{\chapterautorefname}{Chapter}