5

I'm currently compiling a manual in LaTeX and the manual has 3 parts. For part 1 the chapters are called core, for part 2 the chapters are called QI and for part 3 the chapters are called GP. I want the chapters to look like the photo I attached.

what I want the chapters to look like

I'm currently using \renewcommand{\chaptername}{} but it also applies that the chapters for Part 2 are called core but I want the chapters for part 2 and part 3 to be different from each other as well.

What command can I use?

Tonechas
  • 976
Kylie
  • 65
  • Welcome ! See package{titlesec} and provide us a MWE (https://tex.meta.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-example-what-is-that) – flav Nov 26 '19 at 04:32
  • You could use \let\oldchaptername\chaptername before the \renewcommand... , and before the next chapter \renewcommand\chaptername\oldchaptername . –  Nov 26 '19 at 04:44
  • 1
    Can't you use \renewcommand{\chaptername}{} multiple times in your document? – Johannes_B Nov 26 '19 at 05:35
  • Try \documentclass{book} \let\oldchaptername\chaptername \begin{document} \part{Some part} \renewcommand{\chaptername}{} \chapter{A chapter without name} \chapter{Another chapter without name} \part{Some other part} \renewcommand{\chaptername}{\oldchaptername} \chapter{A chapter with name} \chapter{Another chapter with name} \end{document}. –  Nov 26 '19 at 06:01

1 Answers1

5

You can define the names at the beginning, based on the value of the part counter.

\documentclass{book}
\usepackage[a6paper]{geometry} % to get a small image

\renewcommand{\chaptername}{%
  \ifcase\value{part}%
    Chapter\or % 0
    Core\or    % 1
    QI\or      % 2
    GP\else    % 3
    Chapter    % else
  \fi
}
\counterwithin*{chapter}{part}

\begin{document}

\part{Core}
\chapter{Test}

\part{QI}
\chapter{Test}

\part{GP}
\chapter{Test}

\clearpage
\mbox{}

\end{document}

enter image description here

egreg
  • 1,121,712