4

The bold math font is rendered in a very peculiar and ugly way, as you can see in the following image. To be more specific, you can see that the bold letters, w and x appear as if there is a shadow behind them. I tried alternative math fonts with the same result, so it is not font specific. What is the problem and how can I fix it?

enter image description here

MWE

\documentclass{article}

\usepackage{geometry}

\usepackage{titlesec}

\usepackage{fontspec}

\setmainfont
[%
  UprightFont = *,
  BoldFont = *Bold,
  ItalicFont = *It,
  BoldItalicFont = *BoldIt
]{GFSArtemisia.otf}

\usepackage[greek, english]{babel}

\usepackage{amsmath}

\usepackage{bm}

\usepackage{unicode-math}

\usepackage{mathtools}

\begin{document}

Text
%
\begin{equation}
    \pmb{w}^{t+1} = \pmb{w}^{t} + a\cdot f(\pmb{w}^{t}\cdot \pmb{x}^{t})\cdot \pmb{x}^{t}
\end{equation}

\end{document}
10

You have declared some bold fonts but you are using \pmb that is "poor man's bold" which simply over-prints three copies of the letter, offset slightly to give the appearance of bold when no bold font is available.

Use \symbf or \mathbf etc to get the bold characters from the math fonts.

4
  • The first command \symbbf produces an error but the second works great, what is the difference? Thank you very much though, really useful tip that I didn't know! – Adam Apr 28 '20 at 20:37
  • @Adam see the uniocde-math manual they are both defined (or re-defined) there. but basically \symxxx uses the math alphabets from the same font (Unicode math fonts have bold letters up in the U+1Dxxx codepoint range, whereas \mathxxx work as the similarly named commands in pdflatex, and select the same character from a different font (eg a bold font) – David Carlisle Apr 28 '20 at 20:40
  • I will do that, nice explanation, thanks again. – Adam Apr 28 '20 at 20:42
  • 1
    @Mico one day I may learn to type – David Carlisle Apr 28 '20 at 21:08
6

David Carlisle is correct, but I think it would be useful to supplement his answer with an example of how to use Artemisia Bold Italic in math mode:

\documentclass{article}
\usepackage[paperwidth=10cm]{geometry}
\usepackage{titlesec}
\usepackage{unicode-math}
\usepackage[greek, english]{babel}
\usepackage{mathtools}

\defaultfontfeatures{Scale = MatchLowercase}
\setmainfont{GFSArtemisia.otf}[Scale = 1.0]
\setmathfont{Libertinus Math}
\setmathfont[range=up,
             Script=Latin, script-features={}, sscript-features={}
            ]{GFS Artemisia Regular}
\setmathfont[range=it,
             Script=Latin, script-features={}, sscript-features={}
            ]{GFS Artemisia Italic}
\setmathfont[range=bfup,
             Script=Latin, script-features={}, sscript-features={}
            ]{GFS Artemisia Bold}
\setmathfont[range=bfit,
             Script=Latin, script-features={}, sscript-features={}
            ]{GFS Artemisia Bold Italic}

\begin{document}

Text
%
\begin{equation}
    \symbfit{w}^{t+1} =
       \symbfit{w}^{t}
       + a \cdot f\left(\symbfit{w}^{t} \cdot \symbfit{x}^{t}\right)
           \cdot \symbfit{x}^{t}
\end{equation}

\end{document}

Artemisia font sample

The mathastext or mathspec packages would also work, with less boilerplate. (You can at least remove the Script, script-features and sscript-features lines if you choose. Their only purpose is to suppress harmless warning messages.)

I also removed a few packages that are redundant with unicode-math. It loads fontspec and amsmath for you, and has its own \boldmath, \mathbf and \symbf commands that you should use instead of bm.

If you really need to fake a bold face for a font that does not have one, you can do that with the fontspec font option [FakeBold=1.2], or whatever other number looks best.

1
  • 1
    Thanks that is a great answer! – Adam Apr 29 '20 at 16:31

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.