14

When I use \autoref{}, from the hyperref package, to cross reference a \chapter{}, the cross-reference in the text is not capitalized. How can I change this?

\documentclass{report}

\usepackage{hyperref}

\begin{document}

\chapter{Intro}\label{int}
HE First \autoref{int}
\chapter{Next One}

\end{document}

enter image description here

  • You can't this way, but look at the cleveref package and it's \Cref macro –  Dec 07 '17 at 04:09
  • @iled That question is specifically about cross-references in listings environments. How does that apply here? – cfr Jan 08 '18 at 03:59
  • @cfr because that other one is an XY problem. All the answers there also apply here. One may argue then the other question should be reworded. – iled Jan 08 '18 at 07:01
  • @iled But it is questions which are duplicates or not - not answers. – cfr Jan 08 '18 at 18:26
  • 1
    @cfr I understand your point and agree with you. However, the community voted and I believe I can't do anything now. – iled Jan 09 '18 at 00:28

1 Answers1

20

The quickest way is to change the information for \autoref which is stored in a macro named \chapterautorefname, defaulting to chapter by redefinition into being Chapter then.

Please note that any defined autoref information is stored in \Xautorefname, where X is the name of the underlying counter, e.g chapter, part etc.

A more flexible way is to use \usepackage{cleveref} after loading hyperref and replace \autoref{int} by \Cref{int}.

\documentclass{report}

\usepackage{hyperref}

\renewcommand{\chapterautorefname}{Chapter}

\begin{document}

\chapter{Intro}\label{int}
HE First \autoref{int}
\chapter{Next One}

\end{document}

enter image description here