8

My question relates to remove boldface from chapter titles, section and subsection names on removing boldface from chapter titles, section and subsection names, the difference being that I need to remove boldface from chapter titles, section and subsection names from an article class document.

1
  • 2
    Or the simpler sectsty package that allows to say \allsectionsfont{\normalfont}
    – egreg
    Commented Feb 5, 2013 at 16:50

2 Answers 2

7

Here are two options:

  1. sectsty:

    \documentclass{article}
    \usepackage{sectsty}% http://ctan.org/pkg/sectsty
    \allsectionsfont{\normalfont}
    \begin{document}
    \section{A section}
    \subsection{A subsection}
    \subsubsection{A subsubsection}
    \end{document}
    

    This provides a clean and understandable input. Another reference using this approach is available in Is it possible to change text color for all headings?

  2. A patch of the section header printing macro \@sect using etoolbox:

    \documentclass{article}
    \usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
    \makeatletter
    \patchcmd{\@sect}% <cmd>
      {#6}% <search>
      {#6\normalfont}% <replace>
      {}{}% <success><failure>
    \makeatother
    \begin{document}
    \section{A section}
    \subsection{A subsection}
    \subsubsection{A subsubsection}
    \end{document}
    

    This is a little obscure. The sixth argument to \@sect stems from the same argument to \@startsection - the default section-producing macro in latex.ltx. For example, here's an extract for \section, which provides as argument six \normalfont\Large\bfseries:

    \newcommand\section{\@startsection {section}{1}{\z@}%
                                       {-3.5ex \@plus -1ex \@minus -.2ex}%
                                       {2.3ex \@plus.2ex}%
                                       {\normalfont\Large\bfseries}}
    

    The patch inserts \normalfont after every sixth argument, regardless of the section being produced.

Both options produce the output:

5

Here's a solution using the titlesec package

screenshot

A complete MWE follows. The code is commented which should explain the details- let me know if you need further details.

\documentclass{article}

\usepackage{titlesec}   % customizing sections
\usepackage{lipsum}

% custom section
\titleformat{\section}
{\normalfont\Large}% format applied to label+text
{\thesection}% label
{5pt}% horizontal separation between label and title body
{}% before the title body
[]% after the title body

% custom subsection
\titleformat{\subsection}
{\normalfont\large}% format applied to label+text
{\thesubsection}% label
{5pt}% horizontal separation between label and title body
{}% before the title body
[]% after the title body

\begin{document}

\section{My section}
\lipsum[1]
\subsection{My subsection}
\lipsum[2]
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .