In mathspec the command \mathbitis not defined, I followed advice from Ulrike here in order to define it, but it desperately remains in Computer Modern:
\documentclass{article}
\DeclareMathAlphabet {\mathbfit}{OML}{cmm}{b}{it}
\usepackage{mathspec}
\setmainfont{NotoSans-Regular}[
Extension = .ttf,
Ligatures = TeX,
BoldFont = NotoSans-Bold,
ItalicFont = NotoSans-Italic,
BoldItalicFont = NotoSans-BoldItalic,
Numbers = Lining
]
\setmathfont(Digits,Latin,Greek)[
Extension = .ttf,
Ligatures = TeX,
BoldFont = NotoSans-Bold,
ItalicFont = NotoSans-Italic,
BoldItalicFont = NotoSans-BoldItalic,
Numbers = Lining
]{NotoSans-Regular}
\setmathrm[
Extension = .ttf,
Ligatures = TeX,
BoldFont = NotoSans-Bold,
ItalicFont = NotoSans-Italic,
BoldItalicFont = NotoSans-BoldItalic,
Numbers = Lining
]{NotoSans-Regular}
\setmathfont[range=\mathbfit/{num,latin,Latin,greek,Greek},
Extension = .ttf,
Ligatures = TeX,
Numbers = Lining]{NotoSans-BoldItalic}
\begin{document}
Blabla $x, \mathbf{x}, \mathbfit{x}, \mathrm{sin}(x)$
\end{document}
gives
in other words, everything is in Noto Sans (not that I like Noto, but I use it to exemplify the problem with a widely available font) except for the \mathbfit part. How can I solve this issue?
(I read somewhere that I need to use the unicode-math. OK but, first, I have no intention to type math symbols in Unicode, and second, I get compatibility problems such as "amsmath package has to be loaded first" even though I didn't requested any amsmath package…)


NFSSFamilyis great! Thank a lot! What is TU encoding? – yannis Feb 20 '21 at 22:03mathspecwas written, it used to be EU1 (XeLaTeX) or EU2 (LuaLaTeX), but then a new encoding was defined. – egreg Feb 20 '21 at 22:31