64

I am using fancyhdr. With that, using the command

\renewcommand{\chaptername}{Lecture}

has no effect. How can I change the name "Chapter" into something else?

4 Answers 4

78

This problem is not due to fancyhdr, as the following example shows:

\documentclass{book}
\usepackage{fancyhdr}

\renewcommand{\chaptername}{Lecture}

\begin{document}

\chapter{Test chapter}

\end{document}

Perhaps you are using babel with some idiomatic option? If this is the case, the redefinition needs to be made using \addto\captions<language>; for example, in the case of the english option for babel:

\documentclass{book}
\usepackage[english]{babel}
\usepackage{fancyhdr}

\addto\captionsenglish{\renewcommand{\chaptername}{Lecture}}

\begin{document}

\chapter{Test chapter}

\end{document}
0
36

You need to use

\makeatletter
\renewcommand{\@chapapp}{Lecture}
\makeatother

since that's what fancyhdr uses as \chaptername.

2
  • Thanks a lot! I like that kind of plain LaTeX, avoiding conflicts with other packages
    – Black Mild
    Aug 25, 2021 at 8:59
  • Thanks for the hint. It worked for me today. :)
    – Mikasa
    Dec 29, 2022 at 12:37
1

I am unsure whether you are refering to changing the titles of the chapters of changing the page headers. If changing the header, then try changing the following. I have swapped out 'Chapter' for 'Section':

\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ #1}{}}

to:

\renewcommand{\chaptermark}[1]{\markboth{Section\ \thechapter.\ #1}{}}
1

You can use \renewcommand{\chaptername}{name_you_want} if you put it into the document body.

From this point of document to the end or other redefinition, "name_you_want" will be used to customize your chapter names.

You must log in to answer this question.

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