The following minimal example no longer produces bold fonts in math mode, using either {\bf b} or \mathbf{b}.



Text mode: {\bf b} $ = b$

\text{Math mode with \texttt{bf}:}\quad {\bf b} = b

\text{Math mode with \texttt{mathbf}:}\quad \mathbf{b} = b


I am using pdflatex on Ubuntu 20.04. The precise version is:

pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file named COPYING
and the pdfTeX source. Primary author of pdfTeX: Han The Thanh
(pdfTeX) et al. Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11 Compiled with xpdf
version 4.01

On a different computer, with TeX Live 2013, the pdf is created as intended, with bold fonts also in math mode.

Below the output of TeX Live 2013 and TeX Live 2019 side by side.

enter image description here

The following error is reported in the .log file when using TeX Live 2019:

LaTeX Font Warning: Font shape `OT1/cmss/b/n' undefined (Font) using `OT1/cmss/m/n' instead on input line 8.

The same error does not occur when using the older installation.

  • 1
    Similar question: tex.stackexchange.com/q/564794/82917. It seems to be an issue with some recent update. There is an open issue on github which suggests a couple of workarounds. – campa Oct 2 '20 at 10:41
  • Thanks. So this is a recently introduced bug in beamer? Should I answer my own question with the workaround from your link to github? – Robert Oct 2 '20 at 10:58
  • 2
    @Robert No, beamer did not change anything, the latex kernel changed. – samcarter_is_at_topanswers.xyz Oct 2 '20 at 10:59

The following workaround suggested by Ulrike Fischer here worked for me. Adding the line

\DeclareFontShape{OT1}{cmss}{b}{n}{<->ssub * cmss/bx/n}{} 

at the beginning of the document yields the desired behaviour. Crucially, this fix causes no harm when used with older installations of TeX Live, which means I can work on the same file across different platforms.

Thanks to @campa for pointing me to the solution.

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.