2

Alas, yet another question on font selection in mathematics.

I want to avoid bold extended and use bold instead. My main font is computer modern. For text, I managed to change the appearance of bold with the help of this question. Also, changing the font for \mathbf wasn't to hard. But how can I make \bm or \boldmath match the rest of the fonts?

M(n)WE:

\documentclass{scrartcl}
\usepackage{bm}
% Bold in text.
\renewcommand{\bfdefault}{b}
% Bold in \mathbf
\DeclareMathAlphabet{\mathbf}{OT1}{lmr}{b}{n}
\DeclareMathAlphabet{\mathbfit}{OT1}{lmr}{b}{it}
\DeclareMathAlphabet{\mathbxit}{OT1}{lmr}{bx}{it}

\begin{document}
    \begin{itemize}
        \item Text: 
            \textbf{bold BOLD}
        \item \texttt{mathbf}:
            $\mathbf{bold BOLD}$
        \item \texttt{mathbfit}:
          $\mathbfit{bold BOLD}$
        \item \texttt{mathbxit}:
           $\mathbxit{bold BOLD}$
        \item \texttt{bm}:
            $\bm{bold BOLD}$
        \item \texttt{boldmath}:
        {\boldmath $bold BOLD$.}
    \end{itemize}
\end{document}

The issue is that the last two examples show much wider characters than the other examples. In fact, even wider than in the \mathbxit-example.

How can I get the same bold-non-extended letters in \boldmath? Plus: is there a non-extend bold version of \mathcal-letters?

enter image description here

Bubaya
  • 2,279
  • 1
    the fact that \bm outside math mode is not raising an error is an oversight, it is not intended to do work in that context. – David Carlisle Feb 10 '20 at 10:44
  • your final two examples are not clear, you are making bold roman use b not bx, but in the bold math you are using math italic and not showing an example of \mathrm the math italic letters are by default \SetSymbolFont{letters} {bold}{OML}{cmm} {b}{it} so already using b not bx – David Carlisle Feb 10 '20 at 10:49
  • @DavidCarlisle Please consider my edit. I hope that makes clearer what I want to do. – Bubaya Feb 10 '20 at 11:23
  • but you should compare the bold math italic against the normal weight math italic (which you are not showing) math italic has wide sidebearings so adjacent letters look like a product of variables not a word. – David Carlisle Feb 10 '20 at 11:25
  • @DavidCarlisle The letter spacing is not what I am confused about, but about the fact that the "O" in the bm-example is wider than the "O" in the \mathbxit-example (at least, it seems), and both are much wider than the mathbfit-O. – Bubaya Feb 10 '20 at 11:28
  • cm only has one style of math italic bold (which is classed as b in latex) even if some of the letter shapes are wider. I think lm is the same but I'd have to check... yes look at omllmm.fd, the math italic bold is declared as \DeclareFontShape{OML}{lmm}{b}{it}{% with a substritution \DeclareFontShape{OML}{lmm}{bx}{it}% {<->ssub*lmm/b/it}{} so b and bx are the same thig – David Carlisle Feb 10 '20 at 11:37
  • @DavidCarlisle Is there an overview of all the math fonts and versions etc. available (for cm and lm)? – Bubaya Feb 10 '20 at 11:39
  • Look in base fd files for cm, or in /usr/local/texlive/2019/texmf-dist/tex/latex/lm/ (or an equivalent directory in your tex inputs) for the lm fonts known to latex – David Carlisle Feb 10 '20 at 11:40
  • @DavidCarlisle Do I interpret omllmm.fd correctly if I read it as there is only n and bx, and b is only a synonym for bx, but there is no lighter version of boldness? – Bubaya Feb 10 '20 at 11:51
  • actually it's coded as only n and b, with bx being a synonym for b, but either way yes there are only two styles – David Carlisle Feb 10 '20 at 11:55

1 Answers1

1

You need to adjust the bold math variant

\SetSymbolFont{operators}{bold}{OT1}{cmr} {b}{n}

Thi swill affect operators like \log and \mathrm generally and make it use bold rather than bold extended.

The bold math italic font in your last example is wider as math italic has wide sidebearings to make adjacent letters appear as a product of variables rather than a word. The math italic fonts in cm are only available in two styles medium and bold so there is not a separate choice to be made between bold and bold extended.

David Carlisle
  • 757,742
  • That looks the same for me. – Bubaya Feb 10 '20 at 10:06
  • @Bubaya your example document doesn't use \log or \mathrm in the scope of \boldmath – David Carlisle Feb 10 '20 at 10:50
  • 1
    OK, now I understand what this command achieves, at least. Then it seems that \SetSymbolFont{letters}{bold}{OT1}{lmr}{b}{it} works for italics (strangely, not for cmr?). What is necessary for bm to make it use non-extended letters? – Bubaya Feb 10 '20 at 11:24