0

I am using the book class and have several appendices. These are titled 'Appendix A', 'Appendix B', etc., where actually all letters are small caps. To achieve small caps for the labels (A, B, ...), I use \renewcommand{\thechapter}{{\normalfont\scshape \alph{chapter}}}. While that works fine, it also changes the appendix labels in the table of contents to small caps, which I don't want. I can't figure out how to avoid this. Does anyone know of a package, or a trick, that would make the labels A, B, etc., appear as normal capitals in the toc?

The following reproduces the problem:

\documentclass[11pt,b5paper,twoside,dvipsnames]{book}
\RequirePackage{luatex85}
\usepackage{titlesec}
\usepackage[top=1.2in,bottom=1.15in,right=1.15in,left=1.15in,headheight=50pt,headsep=4mm]{geometry}
\usepackage[american]{babel}
\usepackage[titletoc]{appendix}

\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}

\usepackage[no-math]{fontspec}
\setmonofont[Scale=.753]{DejaVu Sans Mono}
\usepackage{ebgaramond}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\usepackage{anyfontsize}
\usepackage[italic,defaultmathsizes,nolessnomore]{mathastext}
\defaultfontfeatures{RawFeature={+calt,+clig,+dlig,liga,cv06}}

\usepackage{fancyhdr}
\pagestyle{fancy}
%\setlength{\headheight}{15pt}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\, #1}}
\fancyhf{} % delete current setting for header and footer
\fancyhead[LE,RO]{\thepage}
\fancyhead[CO]{\textit{\rightmark}}
\fancyhead[CE]{\leftmark}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{50pt} % make space for the rule
\fancypagestyle{plain}{%
\fancyhead{} % get rid of headers on plain pages
\renewcommand{\headrulewidth}{0pt} % and the line
}

\titleformat{\chapter}[display]{}
    {\filcenter\normalfont\romanspaced\large\scshape chapter\ \thechapter}
    {.2cm}
    {\normalfont\Large\romanspaced\itshape\filcenter}
    
\usepackage{titlesec}
\titleformat{\section}[block]{\bfseries\filcenter}{\thesection}{1em}{}
\titleformat{\subsection}[block]{\itshape\filcenter}{\thesubsection}{1em}{}

\begin{document}

\author{\Large Author}
\date{}

\frontmatter

\title{\Huge \textsc{title} \\[5cm] {}}

\maketitle

\begingroup
\defaultfontfeatures{Ligatures={NoContextual}}
\setmainfont{EB Garamond}[
  Numbers={OldStyle,Monospaced},
]
\fancyhead[C]{\emph{Contents}}
\tableofcontents
\endgroup

\pagestyle{fancy}

\chapter{Preface}

\fancyhead[CE]{\leftmark}

Some text here ...

\mainmatter

\pagestyle{fancy}

\fancyhead[CE]{\leftmark}
\fancyhead[CO]{\textit{\rightmark}}

\chapter{Introduction}

Some more text ...

\chapter{Second chapter}

... and more ...

\appendix

\renewcommand{\thechapter}{{\textsc{\alph{chapter}}}}

\titleformat{\chapter}[display]{}
    {\filcenter\normalfont\romanspaced\large\scshape appendix \thechapter}
    {.2cm}
    {\normalfont\Large\romanspaced\itshape\filcenter}

\appendixpage
\noappendicestocpagenum
\addappheadtotoc

\chapter{Proof of Theorem 1}

... still more text ...

\chapter{Proof of Theorem 2}

... and more ...

\end{document}
4
  • 1
    Welcome to TeX SX! Try with \textsc{\alph{chapter}} instead.
    – Bernard
    Aug 14, 2020 at 22:09
  • Thanks, but that didn't change anything.
    – edvard
    Aug 14, 2020 at 23:39
  • Very strange… Could you post a small, yet complete code reproducing the problem?
    – Bernard
    Aug 14, 2020 at 23:41
  • I have edited the question, adding a MWE (though not so minimal -- sorry, this was the best I could do).
    – edvard
    Aug 15, 2020 at 0:25

1 Answer 1

0

A sufficient solution for your example would be to redefine \textsc just before \tableofcontents (while ensuring that the whole is grouped, so the redefinition remains local):

{\renewcommand{\textsc}[1]{\MakeUppercase #1}
\tableofcontents
}

Something more refined would be called for in cases where small caps are needed somewhere in the toc.

1
  • This solved the problem -- thanks!
    – edvard
    Sep 3, 2020 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .