# In book style, how to change the chapter according to style guide

Well for our style we wish to have "small" chapters using the book style (mainly to have \frontmatter grouping)

Now the styles are mainly about where and how the numbering of the chapters happens:

For \frontmatter chapters:
"Summary"
No numbering at all, just the chapter title.

For \mainmatter chapters:
"1. Introduction"
-Normal numbering: number has to be on the same line as chapter

For \appendix chapters:
"Appendix A. Test Data"
- Number them by letters, precede the number with "appendix" has to be on same line as chapter

I've read quit a few topics about this, but I simply can't figure out how to make it work. Especially the "keeping the number on the same line" is not working for me. The best attempt I've come up with is:

\titleformat{\chapter}[display] {\normalfont\huge\bfseries}{\thechapter}{0pt}{\huge}


But that doesn't remove the line break. It also doesn't work for appendices

I've also tried converting to the scrbook class - however that doesn't work for appendices either. (on top of that the chapter font looks really ugly).

A simple example:

\documentclass{scrbook}
\begin{document}
\tableofcontents
\appendix
\chapter{Fluid dynamics}
\end{document}


There are 2 things "wrong" with it: first of all in the table of contents it shows as "A. Fluid dynamics" instead of "Appendix A. Fluid dynamics" (Btw I only wish the "appendix A" to be added to appendices, not for chapters like "chapter 1"). Secondly in the appendix itself it uses 2 lines.

• Please post a complete, compilable small document demonstrating the issue so people have something to work with. Mere fragments can be useful in explanations but are not otherwise terribly helpful. – cfr Mar 5 '15 at 0:18
• @cfr I am a bit wondering what to show then. It is not that the latex code is not working: I just have no idea how to make it work. – paul23 Mar 5 '15 at 0:19
• @egreg editted for that - but that still gets the "appendix" wording on a seperate line. – paul23 Mar 5 '15 at 0:19
• You need to add a minimal working example (MWE) that illustrates your problem. Just follow the link for instructions on what to include. – cfr Mar 5 '15 at 0:22

Since you are using a KOMA class, use KOMA's facilities for configuring things. Details are in the manual.

• headings=small gets small headings throughout.
• chapterprefix=false banishes 'Chapter'.
• appendixprefix=true overrides this for the appendices only.
• \chapterformat is redefined to add horizontal, rather than vertical space - this takes care of the chapters in the main part.
• \chapterheadmidvskip is redefined to avoid the vertical spacing still being added in the appendices due to the use of the prefix here.
• \addchap{} adds an unnumbered chapter which is nonetheless included in the contents.
• \chapter*{} adds an unnumbered chapter excluded from the contents, as in the standard classes.

# Code

\documentclass[headings=small,chapterprefix=false,appendixprefix=true]{scrbook}
\renewcommand*\chapterformat{%
\relax}
\begin{document}
\tableofcontents

• Well to put it frankly: I strongly prefer not to use a koma class - but instead get the koma styles in the normal book class. Especially the koma options instead of geometry break other parts. - I tried the example though and it came up with \chapterheadmidvskip not defined – paul23 Mar 5 '15 at 1:08
• Now I also tried it using my offline version (miktex) same problem with wit the \chapterheadmidvskip, and it reports as version: This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) – paul23 Mar 5 '15 at 1:29