1

I have problem with bold math text in sections and subsections. I want to bold this:

\subsubsection{Wyniki dla ${}^{222}\mathrm{Radon}$}

I tried \boldsymbol{} from THIS SOLUTION but it's not working properly because after that I have bolded text in my table of contents too. I want to remove bold mode in my table of contents. Any ideas how to make it?

  • 1
    I think what you want is dla \textsuperscript{222}Radon not in math mode. – Sigur Mar 6 '18 at 16:15
  • if you want to do this, you should modify your section heading code where it specifies \bfseries to also specify \boldmath – David Carlisle Mar 6 '18 at 16:16
  • @Sigur, it works but how to get mathmode numbers and equal sign without "Z" letter in math mode there? \subsubsection{Wyniki dla pierwiastka o $\mathrm{Z}=123$} – Dawid Mar 6 '18 at 16:21
  • So, in this case it would be better to edit your post and show explicitly a math example, like above. The one you gave suggested me only text content produced wrongly with math mode. – Sigur Mar 6 '18 at 16:22
4

enter image description here

\documentclass{article}

\makeatletter
% copied from article.cls, added \boldmath
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries\boldmath}}

\makeatother

\begin{document}


\tableofcontents
\section{zzz}
\subsection{zz}
\subsubsection{Wyniki dla ${}^{222}$Radon}

\end{document}
| improve this answer | |
2

Just use \textsuperscript:

\documentclass{article}

\newcommand{\isotope}[2]{\textsuperscript{#1}#2}

\begin{document}

\tableofcontents

\section{Wyniki dla \isotope{222}{Radon}}

Wyniki dla \isotope{222}{Radon}

\end{document}

enter image description here

If you really want to embolden math in titles (you shouldn't, in my opinion), use sectsty:

\documentclass{article}
\usepackage{sectsty}

\allsectionsfont{\bfseries\boldmath}

\newcommand{\isotope}[2]{\textsuperscript{#1}#2}

\begin{document}

\tableofcontents

\section{Wyniki dla \isotope{222}{Radon}}

Wyniki dla \isotope{222}{Radon}

\section{Wyniki dla pierwiastka o $\mathrm{Z}=123$}

Wyniki dla pierwiastka o $\mathrm{Z}=123$

\end{document}

enter image description here

If you want bold math everywhere boldface is used:

\documentclass{article}
\usepackage{xpatch}

\xapptocmd\bfseries{\boldmath}{}{}

\newcommand{\isotope}[2]{\textsuperscript{#1}#2}

\begin{document}

\tableofcontents

\section{Wyniki dla \isotope{222}{Radon}}

Wyniki dla \isotope{222}{Radon}

\section{Wyniki dla pierwiastka o $\mathrm{Z}=123$}

Wyniki dla pierwiastka o $\mathrm{Z}=123$

\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.