3

Inspired by Mr. Carlisle's answer here, I was wondering how to use a bold sans serif math font.

The way one can create normal bold sans serif text is as follows:

\documentclass[]{standalone}

\begin{document}
\textbf{\textsf{This text is bold.}}
\end{document}

How would I get bold sans serif math, though? I tried many combinations, such as:

\documentclass[]{standalone}

\begin{document}
\textbf{$\mathsf{x^2+2}$}
\end{document}

None of these seem to give bold sans serif math effect, though!

  • 1
    you can use \boldmath as I used in the referenced answer, or for a subterm inside a larger math expression, you can use \bm from the package of that name. – David Carlisle Nov 20 '16 at 15:08
5
\documentclass[]{standalone}
\usepackage{bm}
\begin{document}
{\boldmath $\mathsf{x^2+2}$}

$\bm{\mathsf{x^2+2}}$
\end{document}

enter image description here

  • This happens to be that one combination that I hadn't tried! Thanks again! – Skeleton Bow Nov 20 '16 at 15:34
1

To extend the answer into the unicode space, the unicode-math package (using fontspec in the background) allows mapping one (or more) ranges of alphabet symbols, say italic and upright, to another range, say bold sans upright, with the range option. The 17 ranges (up, it, frak, tt, cal, etc) can be restricted to lower/upper/Latin/Greek or numbers, as well.

For specific (grouped) symbols, the various \sym..{} commands, like \symbf{} for bold face, perform a similar function.

unicode-math mapping to bold

Key to the illustration: Italic (magenta); italic mapped to bold sans upright (red); both italic and upright mapped to bfsfup; upright version of \sym..{} command; the \symbfsfup command.

\documentclass[12pt]{standalone}
\usepackage{xcolor}
\usepackage{unicode-math}
\setmathfont{Asana Math}[Colour=blue]
%\setmathfont{Asana Math}[range={it},Colour=magenta]
\setmathfont{Asana Math}[range={it->bfsfup,up->bfsfup},Colour=red]
\setmainfont{Noto Serif}
\begin{document}
\begin{tabular}{rl}
\verb|range={it->bfsfup,up->bfsfup}| & $AB ab \Phi \Mu \Lambda \phi \mu \lambda 123$ \\
\end{tabular}
\end{document}

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.