0

I am trying to get a chapter header where I include the chapter number to the title without the "chapter n" before the chapter title.

This thread helped to remove the "chapter n", but I don't know how to include the numbering into the header.

Here an example with my current output. Desired output would show "1 Foo" (Or even better: "1. Foo") etc

\documentclass{book}

% from https://tex.stackexchange.com/questions/120740/how-do-i-remove-chapter-n-from-the-chapter-titles-of-a-book \makeatletter \def@makechapterhead#1{% \vspace*{50\p@}% {\parindent \z@ \raggedright \normalfont \interlinepenalty@M \Large \bfseries #1\par\nobreak \vskip 40\p@ }}

\makeatother

\begin{document}

\chapter{Foo}

\end{document}

enter image description here

tjebo
  • 103

1 Answers1

1

The default definition of \@makechapterhead is this:

\vspace *{50\p@ }%
    {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne \if@mainmatter%
        \huge \bfseries \@chapapp \space \thechapter%
        \par \nobreak \vskip 20\p@
    \fi \fi%
    \interlinepenalty\@M
    \Huge \bfseries #1\par \nobreak%
    \vskip 40\p@
}

Splitting the difference between that and the definition you're using, you might try this:

\documentclass{book}

% from https://tex.stackexchange.com/questions/120740/how-do-i-remove-chapter-n-from-the-chapter-titles-of-a-book \makeatletter \def@makechapterhead#1{% \vspace*{50\p@}% {\parindent \z@ \raggedright \normalfont \interlinepenalty@M \Huge \bfseries \ifnum \c@secnumdepth >\m@ne \if@mainmatter \thechapter. \fi \fi #1\par\nobreak \vskip 40\p@ }}

\makeatother

\begin{document}

\chapter{Foo}

\end{document}

1. foo

Or you could use \Large instead of \Huge to be more like your original definition, or \huge for something in between.

frabjous
  • 41,473