0

Apologies if this is a duplicate; I've found some similar questions but nothing that exactly addresses my problem.

I'd like to rename alternate chapter headings in my book-class LaTeX document. I'm aware of using \renewcommand to achieve this for every chapter heading, but can this be modified to only rename alternate chapters?

i.e.

for i in [Chapter 1, Chapter 3, Chapter 5, ...]:
    \renewcommand{\chaptername}{Lecture}
  • You could use the \titleformat command from the package titlesec and use a conditional for odd chapter numbers. – Phelype Oleinik Dec 19 '17 at 22:31
3

You can add a test to \chaptername itself:

\documentclass{book}
\usepackage[english]{babel}
\addto\captionsenglish{\renewcommand\chaptername{\ifodd\value{chapter}Lecture\else Something else\fi}}
\begin{document}
\chapter{A} \chapter{B} \chapter{C}
\end{document}

This naturally assume that you are not using the command in some other place where the test it not suited.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.