0
当我使用 编译以下代码时,我会得到预期的粗体效果。但是,使用 时pdflatex
,效果正常(不粗体)。是否有任何解决方法可以使 变得粗体?0
lualatex
0
lualatex
\documentclass{article}
\usepackage{newtxsf}
\usepackage{bm}
\begin{document}
$0$
$\bm{0}$ % OK with pdflatex, but not with lualatex
$a$
$\bm{a}$ % always OK
$\beta$
$\bm{\beta}$ % always OK
\end{document}
我的环境是
pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016)
LuaTeX, Version 0.95.0 (TeX Live 2016)
bm: 2016/07/07
newtxsf: July 4, 2015
答案1
\documentclass{article}
\usepackage{newtxsf}
\usepackage{bm}
\makeatletter
\def\bm@umathchar#1#2#3{%
\@tempcnta#2\relax
\count@\bm@table
\ifnum\count@=\z@
\bm@gr@up\boldmath{\Umathchar#1 #2 #3 }%
\else
\ifnum\count@=\m@ne
\else
\advance\@tempcnta\count@
\fi
\bm@xadd{\Umathchar#1\space
\the\@tempcnta\space\space
#3\space}%
\fi}
\makeatother
\begin{document}
$0$
$\bm{0}$ % OK with pdflatex, but not with lualatex
$a$
$\bm{a}$ % always OK
$\beta$
$\bm{\beta}$ % always OK
\end{document}