7

How is it possible to remove the boldface from chapter titles, section and subsection names? I have found the following code for sections, but I can't find a way for chapters and subsections.

\makeatletter
 \renewcommand\section{\@startsection {section}{1}{\z@}%
 {-3.5ex \@plus -1ex \@minus -.2ex}%
 {2.3ex \@plus.2ex}%
 {\normalfont\Large}}
 \makeatother

EDIT: Be sure to check the answer I provided in addition to Tobi's and Werner's answers.

niels
  • 3,295

3 Answers3

11

Depending on the class you are using there are different more or less easy ways.

If you use* KOMA-Script (which is recommended especially for german texts) you can change the disposition font element:

\documentclass{scrbook}% analogus to book class

\setkomafont{disposition}{\mdseries\rmfamily}

\begin{document}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
\end{document}

Otherwise the titlesec package may helps

\documentclass{book}

\usepackage[md]{titlesec}

\begin{document}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
\end{document}

The titlesec package would work with KOMA-Script too …

* A full working minimal working example (MWE) would have showed the class so I don’t have to guess ;-)

Tobi
  • 56,353
6

You could also patch the standard book document class commands using etoolbox:

enter image description here

\documentclass{book}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\patchcmd{\@makechapterhead}{\bfseries}{\relax}{}{}% Non-bold \chapter name
\patchcmd{\@makechapterhead}{\bfseries}{\relax}{}{}% Non-bold \chapter title
\patchcmd{\section}{\bfseries}{\relax}{}{}% Non-bold \section
\patchcmd{\subsection}{\bfseries}{\relax}{}{}% Non-bold \subsection
\makeatother
\begin{document}
\chapter{First chapter} This is a chapter.
\section{First section} This is a section.
\subsection{First subsection} This is a subsection.
\end{document}

The reason for patching \@makechapterhead twice is because the name (Chapter) and title is separately typeset in \bfseries.

Werner
  • 603,163
  • How does etoolbox differentiate between the two \@makechapterhead patches? – Tobi Dec 14 '11 at 22:41
  • @Tobi: etoolbox patches only the first equal command. – Marco Daniel Dec 14 '11 at 22:44
  • 2
    @Tobi: It patches the first command corresponding to the given string. Therefore, two calls with the same arguments will patch the second occurrence of the same string. This is the case with \@makechapterhead, since \bfseries is used twice - once for the chapter name (\chaptername \thechapter) and once for the chapter title. – Werner Dec 14 '11 at 22:59
  • @MarcoDaniel, Werner: Thanks for this explanation :-) – Tobi Dec 14 '11 at 23:24
0

This answer is actually a comment on Werner's answer. Although initially I accepted and used Tobi's answer, in the end I decided to use the method described in Werner's answer.

I noticed some interesting things I'd like to share. It all started when I decided to leave chapter titles (Chapter 1,2...) bold but remove boldface from chapter names (Introduction, ...).

Here is an excerpt from book.cls

\def\@makechapterhead#1{%
  \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@
  }}

The first \bfseries refers to chapter title (Chapter 1,2...) and the second to chapter name.

So:

If I simultaneously use

\patchcmd{\@makechapterhead}{\bfseries}{}{}{}
\patchcmd{\@makechapterhead}{\bfseries}{}{}{}

neither chapter title nor name should be bold. And indeed this is what happens.

If I use only

\patchcmd{\@makechapterhead}{\huge\bfseries }{\huge }

the chapter title shouldn't be boldface but the chapter name should be. And indeed this is what happens.

BUT

If I use

\patchcmd{\@makechapterhead}{\Huge \bfseries}{\Huge }{}{}

I expect the chapter title to be boldface and the chapter name to be non-boldface. Instead both elements are boldface!!!!

Somehow the first (refering to chapter title) \bfseries also affects the chapter name (I don't know why but I guess people that know more about latex syntax could explain).

In order to bypass this behavior, I had to limit the scope of that first \bfseries. So I used

\patchcmd{\@makechapterhead}{\huge\bfseries \@chapapp\space \thechapter}{\huge{\bfseries \@chapapp\space \thechapter}}{}{}

(note the extra pair of curly brackets inserted to enclose \bfseries \@chapapp\space \thechapter)

After this patch then \patchcmd{\@makechapterhead}{\Huge \bfseries}{\Huge }{}{}

works as expected.

niels
  • 3,295