# Making bold subsection-headings in math, but not bold in ToC

I am writing in the document type article, and I wish to have my subsection appear in bold itself, but appear normal in the ToC. I am trying to write a chemical formula, which automatically converts the text to non-bold, when using \ce. I chose to do it like this:

\subsection{formation of $\mathbf{N_2O}$ during $\mathbf{NH_3 - SCR}$}


This will make the subsection appear bold, but also it will make the text in \mathbf appear bold in the ToC. I would like to just have the sections appear bold, and the subsections to appear normal in the ToC

• I don't see \ce here?
– user31729
Jan 14 '16 at 13:11
• Thanks! it worked out just fine. I just had to replace \mathbf with \mathrm to make the chemical equations appear non-italic in the [...] Jan 14 '16 at 13:11
• no I couldn't use it, since I couldn't make it appear in bold when using \ce. it was irrelevant information now I think about it.. Jan 14 '16 at 13:12

If \ce is used, there's no need to use either \mathbf nor the optional argument of the \subsection command at all.

\documentclass{article}

\usepackage[version=4]{mhchem}
\begin{document}
\tableofcontents
\section{Foo}
\subsection{Foobar}
\subsection{formation of \ce{N2O} during \ce{NH3}-SCR}

\end{document}


Remove the \mathbf from the section head, and then just specify that you want math to be bold in the heading at the same point as you specify bold text, for example in article the default definition is

\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries}}


and you want

\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries\boldmath}}