0

I am using a header with sffamily as my font, as follows:

\documentclass[]{standalone}

\usepackage{titlesec}
\titleformat{\section}{\Large\sffamily\bfseries}{\thesection}{1em}{}

\begin{document}

\section{Let $x^2=1$}

\end{document}

However, the x=1 part in the header doesn't look nice, as it uses a much thinner font than the header. I tried changing it to \mathbf{$x=1$}, but it still doesn't look like nice as I am using sffamily as my font. Is there any way to make it look a bit better?

Skeleton Bow
  • 1,179

1 Answers1

1

Your example generates an error but you can get bold math via

enter image description here

 \documentclass{article}

\usepackage{titlesec}
\titleformat{\section}{\Large\sffamily\bfseries\boldmath}{\thesection}{1em}{}

\begin{document}

\section{Let $x=1$}
\section{Let $\mathsf{x=1}$}

\end{document}
David Carlisle
  • 757,742