7

I am having some troubles producing numbers in math mode in bold. \mathbf{} command worked with the mathptmx package, producing bold numbers that looked like numbers in math mode, but bold. Then I started using the newtxmath package alongside the bm and now they look not like I want to.

mathbf{1} produces a symbol which looks like number 1, but like a text-mode 1. While \bm{} and \boldsymbol won't work. Here is an output of

$\bm{1}$\\
$\boldsymbol{1}$\\
$\mathbf{1}$\\
\textbf{1}

ones

Am am using Georgia font with its "low" numbers, so you can definitively tell the difference between math mode and text mode.

Is there any solution for this problem?

Here is the full code (you need Lua or Xe LaTex to compile):

\documentclass[10pt]{article}

\usepackage{newtxmath}
\usepackage{bm}

\usepackage{polyglossia}    
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Georgia}
\newfontfamily\cyrillicfont{Georgia}
\setmainlanguage{russian}

\begin{document}
\noindent
$\bm{1}$\\
$\boldsymbol{1}$\\
$\mathbf{1}$\\
\textbf{1}
\end{document}

UPDATE: The thing finally worked, when I have compiled the file on another PC. Which is strange, because as I get it, TexLive updates the packages and compilers automatically, so it doesn't seem to be a matter of version.

It would be great if somebody explains me what is going on here.

1
  • texlive only updates when you run tlmgr update, you can add \listfiles to the document preamble and compare the package version at the end of each log. (there were some updates to bm last year to be a bit less broken in luatex, for example) Feb 28, 2017 at 22:56

2 Answers 2

2

You’re loading polyglossia, which loads fontspec, and using an OpenType font. This is not compatible with the legacy package bm.

One solution is:

\usepackage{unicode-math}
\defaultfontfeatures{ Ligatures=TeX, Scale=MatchLowercase }
\setmathfont{TeX Gyre Termes Math} % Or another math font
\setmathfont{Georgia}[range=up]
\setmathfont{Georgia Italic}[range=it]
\setmathfont{Georgia Bold}[range=bfup]
\setmathfont{Georgia Bold Italic}[range=bfit]

This will allow you to use \mathbf{1} or \symbf{1}. If you don’t ever use \mathbf for words in math mode, you might use the option \usepackage[mathbf=sym]{unicode-math}, and make \mathbf a synonym for \symbf. Theoretically, this invokes the bold alphanumeric symbols from your math font, rather than a text font, although here you’re setting them both to the same font anyway. You can still use \textbf (or, more robustly, \textnormal{\bfseries ...}) in math mode.

If you have a version of Georgia that supports lining numbers, you can additionally give the supplemental \setmathfont commands the option Numbers=Lining. Or, if you specifically want to use Georgia for letters and not numbers, you may specify range=up/{Latin,latin,Greek,greek}, etc.

You can change the \mathbf font, which is intended for words and short phrases in math mode, to something different from your main text font with \setmathrm[BoldFont={...}, BoldFeatures={...}]. Alternatively, you can call \usepackage[no-math]{fontspec} before polyglossia to prevent it from changing \mathbf, \mathrm, and so on.

The unicode-math package does support \boldsymbol, but this calls \mathversion{bold}. As of 2020, unicode-math does not support both the version=bold and range= options of \setmathfont at the same time, so you cannot reliably use \boldsymbol and also change the letters in math mode.

Other options to change the math font to Georgia are mathastext, or, in XeTeX, mathspec.

1

Nope, TeXlive is just another distribution, with version numbers.

people use it because it contains more or less the kitchensink and everything and it's maintained, but it definitely has version numbers.

and the people who deal with it very often will try to make sure pieces work together.

also, due to its gigantic size, TeXlive may be split over several small subpackages in your distribution.

That's quite enough to explain differences between renderings.

in general, if you run into such a problem, reproducibility is key... so generally, logs of version numbers of used LaTeX packages may help a lot.

1
  • 1
    Welcome to TeX.SE!
    – Zarko
    Dec 21, 2020 at 13:36

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.