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}
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.
Best Answer
You’re loading
polyglossia
, which loadsfontspec
, and using an OpenType font. This is not compatible with the legacy packagebm
.One solution is:
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 optionNumbers=Lining
. Or, if you specifically want to use Georgia for letters and not numbers, you may specifyrange=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}
beforepolyglossia
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 theversion=bold
andrange=
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
.