0

Using the combination \MakeTextLowercase and \cftchapterfont in the memoir class with the hyperref package causes strange issues when attempting to make the table of contents’ chapter titles minuscule.

\documentclass{memoir}
\usepackage{hyperref}
\renewcommand*{\cftchapterfont}{\MakeTextLowercase}
\begin{document}
\tableofcontents
\chapter{This Is a Chapter}
\end{document}

garbled pdf output

The first errors are like this, and then follows a load of missing/extra {/} and control sequences.

! Undefined control sequence.
\find@pdflink ...ode \protected@edef \Hy@testname
                                                  {#2}\ifx \Hy@testname \@em...
l.1 ...entsline {chapter}{Contents}{1}{section*.1}

I think some packages/fonts have an option to always use minuscule small caps, but I want to use garamondx and from my reading of the garamondx manual, I have yet to find a way. How can I make hyperref behave?

gnucchi
  • 946
  • \MakeTextLowercase is not expandable and can't go to the ToC generated with hyperref –  Oct 01 '17 at 21:45
  • Besides, \MakeTextLowercase is not a font changing declaration. The \cftchapterfont should be defined as a declaration such as \scshape or \bfseries, whereas \MakeTextLowercase is a command taking an argument. – egreg Oct 01 '17 at 21:52
  • Hyperref modifies \contentsline to produce a \hyperlink, and \cftchapterfont is applied AFTER \contentsline (inside \l@chapter). – John Kormylo Oct 01 '17 at 22:02
  • What alteratives are there in that case? Is there a font declaration for rendering minuscule small caps, indiscriminately? – gnucchi Oct 01 '17 at 22:04
  • I took the inspiration from section 9.2 (p. 155) in the memoir manual, so assumed it was appropriate: \renewcommand\cftchapterfont{\scshape\MakeTextLowercase} – gnucchi Oct 01 '17 at 22:06
  • 1
    Chapter has a [short title] option for the toc. – John Kormylo Oct 01 '17 at 22:08
  • Is there a way to make it do that automatically, without it giving errors about the use of \@chapter not matching the definition, or being unusable when you actually want another title in the ToC? – gnucchi Oct 01 '17 at 22:21
  • 1
    See page 158 in the manual, there is an entire named section about this issue. – daleif Oct 02 '17 at 05:34

0 Answers0