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.
2 Answers
Here are two options:
-
\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?
A patch of the section header printing macro
\@sect
usingetoolbox
:\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 inlatex.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:
Here's a solution using the titlesec
package
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}
sectsty
package that allows to say\allsectionsfont{\normalfont}