[Tex/LaTex] Bold math in title but not in TOC

boldmath-modetable of contentstitles

I've seen similar problems around but I haven't been able to solve mine.

Basically, I have a bold math in section title but I don't want it to be bold in TOC as in figures below.

Figure 1

Figure 2

My code for these is:

\section{L\texorpdfstring{\textsubscript{L1} = 1.2\boldmath{$H$}}{First magnet}}\label{1st_magnet}

Thanks!

Best Answer

A solution with titlesec:

\documentclass[11pt, fleqn]{book}
\usepackage{titlesec}
\titleformat*{\section}{\bfseries\boldmath}
\usepackage[detect-all]{siunitx}
\usepackage{hyperref} % for \texorpdfstring

\setcounter{chapter}{4}

\begin{document}

\tableofcontents

\section{\texorpdfstring{$L_\text{L1} = \SI{1.2}{\henry}$}{First magnet}}
\label{1st_magnet}

\end{document} 

enter image description here

Related Question