Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

\fancyheader + \MakeLowercase

57 views
Skip to first unread message

Haines Brown

unread,
Aug 24, 2016, 10:24:49 AM8/24/16
to
I apologize for what must surely be a FAQ.

In book class and with fancyhdr package, I define fancy headers like
this:

...
\pagestyle{fancy}
\fancyhead[LO]{\slshape \leftmark}
...

This does as I expect, but I want to make the chapter titles lower
case. So I tried:

\fancyhead[LO]{\MakeLowercase\slshape\leftmark}
\fancyhead[LO]{\MakeLowercase{\slshape\leftmark}}
\fancyhead[LO]{\nouppercase\slshape\leftmark}

but don't get lower case. How do I do it?

Haines Brown

Alain Ketterlin

unread,
Aug 24, 2016, 11:08:12 AM8/24/16
to
Haines Brown <hai...@engels.histomat.net> writes:

> I apologize for what must surely be a FAQ.

It is actually explained in fancyhdr's documentation (Section 9, "The
scoop on LaTeX’s marks") .

> ...
> \pagestyle{fancy}
> \fancyhead[LO]{\slshape \leftmark}
> ...
>
> This does as I expect, but I want to make the chapter titles lower
> case.

book.cls itself changes chapter marks into uppercase. Redefining
\chaptermark would probably be the easiest.

> So I tried:
>
> \fancyhead[LO]{\MakeLowercase\slshape\leftmark}
> \fancyhead[LO]{\MakeLowercase{\slshape\leftmark}}
> \fancyhead[LO]{\nouppercase\slshape\leftmark}

\nouppercase takes an argument (\slshape here, which is probably not
what you want). Try \slshape\nouppercase{\leftmark} instead. (Untested.)

-- Alain.

Haines Brown

unread,
Aug 24, 2016, 1:23:10 PM8/24/16
to Alain Ketterlin
Alain Ketterlin <al...@universite-de-strasbourg.fr.invalid> writes:

> Haines Brown <hai...@engels.histomat.net> writes:
>
>> I apologize for what must surely be a FAQ.
>
> It is actually explained in fancyhdr's documentation (Section 9, "The
> scoop on LaTeX’s marks") .

Yes I'm starting to read it.

...
>> \pagestyle{fancy}
>> \fancyhead[LO]{\slshape \leftmark}
>> ...
>>
>> This does as I expect, but I want to make the chapter titles lower
>> case.
>
> book.cls itself changes chapter marks into uppercase. Redefining
> \chaptermark would probably be the easiest.

Perhaps, but redefining seems intimidating.

>> So I tried:
>>
>> \fancyhead[LO]{\MakeLowercase\slshape\leftmark}
>> \fancyhead[LO]{\MakeLowercase{\slshape\leftmark}}
>> \fancyhead[LO]{\nouppercase\slshape\leftmark}
>
> \nouppercase takes an argument (\slshape here, which is probably not
> what you want). Try \slshape\nouppercase{\leftmark} instead. (Untested.)

Thanks Alain, your suggestion worked nicely. But I'm wondering why you
said \slshape is probably not what I want. Do you mean \itshape is
preferable?

Haines

Haines Brown

unread,
Aug 24, 2016, 1:25:59 PM8/24/16
to
Alain Ketterlin <al...@universite-de-strasbourg.fr.invalid> writes:

> Haines Brown <hai...@engels.histomat.net> writes:
>
>> I apologize for what must surely be a FAQ.
>
> It is actually explained in fancyhdr's documentation (Section 9, "The
> scoop on LaTeX’s marks") .

Yes I'm starting to read it.

...
>> \pagestyle{fancy}
>> \fancyhead[LO]{\slshape \leftmark}
>> ...
>>
>> This does as I expect, but I want to make the chapter titles lower
>> case.
>
> book.cls itself changes chapter marks into uppercase. Redefining
> \chaptermark would probably be the easiest.

Perhaps, but redefining seems intimidating.

>> So I tried:
>>
>> \fancyhead[LO]{\MakeLowercase\slshape\leftmark}
>> \fancyhead[LO]{\MakeLowercase{\slshape\leftmark}}
>> \fancyhead[LO]{\nouppercase\slshape\leftmark}
>
> \nouppercase takes an argument (\slshape here, which is probably not
> what you want). Try \slshape\nouppercase{\leftmark} instead. (Untested.)

quark67

unread,
Aug 25, 2016, 9:05:14 AM8/25/16
to
Haines Brown <hai...@engels.histomat.net> wrote:

> Alain Ketterlin <al...@universite-de-strasbourg.fr.invalid> writes:
>
> > Haines Brown <hai...@engels.histomat.net> writes:
> >

> >> So I tried:

> >> \fancyhead[LO]{\nouppercase\slshape\leftmark}
> >
> > \nouppercase takes an argument (\slshape here, which is probably not
> > what you want). Try \slshape\nouppercase{\leftmark} instead. (Untested.)
>
> Thanks Alain, your suggestion worked nicely. But I'm wondering why you
> said \slshape is probably not what I want. Do you mean \itshape is
> preferable?
>
> Haines

No.

> >> \fancyhead[LO]{\nouppercase\slshape\leftmark}
> >
> > \nouppercase takes an argument (\slshape here, which is probably not
> > what you want)

He will say this:
\nouppercase\slshape\leftmark

is in fact:
\nouppercase{\slshape}\leftmark

Would you use \nouppercase on a command changing the shape of the font?
> > (\slshape here, which is probably not what you want)

So he suggest:
> > Try \slshape\nouppercase{\leftmark} instead.

So \nouppercase act on \leftmark.

Peter Flynn

unread,
Sep 3, 2016, 6:23:19 PM9/3/16
to
On 24/08/16 18:25, Haines Brown wrote:
> Alain Ketterlin <al...@universite-de-strasbourg.fr.invalid> writes:
[...]
>>> This does as I expect, but I want to make the chapter titles lower
>>> case.
>>
>> book.cls itself changes chapter marks into uppercase. Redefining
>> \chaptermark would probably be the easiest.
>
> Perhaps, but redefining seems intimidating.

That's the only way to do it: if you \MakeLowercase (even if it worked),
it would make *all* the title lowercase.

IMHO it was a Really Bad Idea to uppercase the marks in LaTeX by default
(one of the very few areas where LL missed the point).

I snipped the definition of \chaptermark out of book.cls and just
removed the string \MakeUppercase (and got rid of the extra # in both
cases):

\documentclass{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LO]{\slshape \leftmark}
\makeatletter
\def\chaptermark#1{%
\markboth {{% removed \MakeUppercase
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter. \ %
\fi
\fi
#1}}{}}%
\makeatother
\begin{document}
\chapter{Introduction}
Stuff
\clearpage
More stuff
\clearpage
Yet more stuff
\end{document}

[...]
>>> \fancyhead[LO]{\nouppercase\slshape\leftmark}
>>
>> \nouppercase takes an argument (\slshape here, which is probably not
>> what you want). Try \slshape\nouppercase{\leftmark} instead. (Untested.)
>
> Thanks Alain, your suggestion worked nicely. But I'm wondering why you
> said \slshape is probably not what I want. Do you mean \itshape is
> preferable?

No. I think he meant that \nouppercase REQUIRES a TEXT argument in curly
braces: \nouppercase{\leftmark}, for example. Putting \slshape after it
makes it try to operate on \slshape instead of on \leftmark.

///Peter

0 new messages