2

I stumbled upon the following issue: the document

\documentclass{scrartcl}
\usepackage{cmbright,amsmath}
\usepackage[T1]{fontenc}
\begin{document}
    \mathversion{bold} $a \cap b \cup c = \beta$ {\fontseries{sb}\slshape a,b,c}
\end{document}

compiles nicely to give . However, if I change the document class to beamer, wrong font is selected for bold math letters (presumably T1/cmbr/bx/n?). The document:

\documentclass{beamer}
\usepackage{cmbright,amsmath}
\usepackage[T1]{fontenc}
\begin{document}
    \begin{frame}
        \mathversion{bold} $a \cap b \cup c = \beta$ {\fontseries{sb}\slshape a,b,c}
    \end{frame}
\end{document}

gives . I tried to declare another math version:

\documentclass{beamer}
\usepackage{cmbright,amsmath}
\usepackage[T1]{fontenc}
\DeclareMathVersion{varbold}
\SetSymbolFont{letters}{varbold}{OML}{cmbrm}{b}{it}
\begin{document}
    \begin{frame}
        \mathversion{varbold} $a \cap b \cap c = \beta$ {\fontseries{sb}\slshape a,b,c}
    \end{frame}
\end{document}

or even using \SetSymbolFont{letters}{varbold}{T1}{cmbr}{sb}{sl} (which of course gives rubbish for everything except latin letters, but let that issue apart) does not give an improvement. What's happening?

4

The beamer package redefines a number of fonts by default in order to get sans-serif math. This clashes with cmbright (by redefining bold math to use bx rather than sb).

Since you already had the fonts set up the way you wanted them, suppress these redefinitions by adding the line

\usefonttheme{professionalfonts}

to your preamble. You could also use the professionalfonts package option.

Edit

For once, it wasn’t me who submitted another answer about how, by the way, you could do this with unicode-math instead.

It’s a good answer! With a few changes, it can even support the standard \mathversion{bold}, \boldmath and \boldsymbol commands. I also set up \sbseries and \textsb commands analogous to \bfseries and \textbf.

\documentclass[professionalfonts]{beamer}
\usepackage{unicode-math}
\defaultfontfeatures[FiraSans]{
  FontFace = {sb}{n}{FiraSans-Semibold.otf},
  FontFace = {sb}{sl}{FiraSans-SemiboldItalic.otf}
  FontFace = {sb}{it}{FiraSans-SemiboldItalic.otf}
}
\usepackage{FiraSans}
\usepackage{firamath-otf}

\DeclareRobustCommand\sbseries{\fontseries{sb}\selectfont}
\DeclareTextFontCommand{\textsc}{\sbseries}

\setmathfont[version=bold, FakeBold = 1.2]{Fira Math}

\begin{document}
    \begin{frame}
        \mathversion{bold} $a \cap b \cup c = \beta$ {\sbseries\slshape a,b,c}
    \end{frame}
\end{document}

Fira sample

You can tweak the FakeBold value to make the font a bit darker if you want.

If you’re not planning to use both bold and semi-bold in the same document, which is usually not a good idea anyway, you could define the bold weight as semi-bold instead.

| improve this answer | |
3

Run with xelatex or lualatex:

\documentclass[professionalfonts]{beamer}
\usepackage{amsmath}
\usepackage{FiraSans}
\usepackage[fakebold]{firamath-otf}
\begin{document}
\begin{frame}

$a \cap b \cap c = \beta$ 

$\setBold a \cap b \cap c = \beta\unsetBold$

\end{frame}
\end{document}

enter image description here

| improve this answer | |
  • Nice answer! I edited my own to talk about it a bit. – Davislor Jun 23 at 15:40

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.