# Appendix labels in small caps and hyperref

I'm using the book class and I'd like appendix labels (letters) to be in small caps everywhere, particularly those generated by \ref and \autoref. I've tried doing it by redefining \thechapter after the \appendix command (or by patching the command in the preamble), but I run into an error with theorem headings if I use hyperref.

The example is:

\documentclass{book}
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{Theorem}{Theorem}[chapter]
\usepackage{hyperref}

\begin{document}
\appendix
\renewcommand{\thechapter}{\textsc{\alph{chapter}}}
\chapter{An appendix}
\section{First section in the appendix} \label{sec:first}
We refer to \ref{sec:first}.
\begin{Theorem}[A theorem] Theorem text. \end{Theorem}
\end{document}


It doesn't compile, while if I remove hyperref it works and the label generated by \ref is correctly in small caps.

(In the actual document I get a different error which has to do with microtype and using Minion Pro, but it also disappears if I remove hyperref and redefine \autoref to be \ref.)

Is there some other way to change this? A solution which applies small caps only to the output of \ref and \autoref would be fine, since elsewhere (section and theorem headings and so on) the label is already in small caps in my actual document.

• \textsc isn't expandable, this will break. Use \scshape instead. But why do you want to have lower case letters? And welcome to TeX.SX! – user31729 Jul 31 '15 at 8:36

Despite of the non standard way: \textsc is a non-expandable command, this will break in conjunction with hyperref. The expandable form is \scshape (small caps shape).

The real problem is however, that \chapter, \section etc. use \bfseries to display the heading titles of of chapters etc. There is no bold small caps version of the standard fonts, so this will not display as small caps then, that's why \thesection and \section display a instead of A.

In my opinion \alph should be replaced by \Alph here!

However, I don't recommend this smallcaps here at all, especially since A in small caps is smaller than the numbers.

\documentclass{book}
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{Theorem}{Theorem}[chapter]
\usepackage[bookmarksopen=true,bookmarksnumbered]{hyperref}

\begin{document}
\tableofcontents
\chapter{Main matter chapter}
\appendix
\renewcommand{\thechapter}{{\scshape \alph{chapter}}}

\chapter{An appendix}
\section{First section in the appendix} \label{sec:first}
We refer to \ref{sec:first}.
\begin{Theorem}[A theorem] Theorem text. \end{Theorem}
\end{document}


• @touhami: Yes, just wondered it did not work. I reset it – user31729 Jul 31 '15 at 8:57
• \appendix \renewcommand{\thechapter}{{\normalfont\scshape \alph{chapter}}} – touhami Jul 31 '15 at 9:02
• @touhami: Wouldn't that look strange in the chapter etc. titles? – user31729 Jul 31 '15 at 9:03
• yes i think it is – touhami Jul 31 '15 at 9:05
• @touhami: I had that in mind, already, but as said: It's strange rather then. – user31729 Jul 31 '15 at 9:06