0

I am not sure why when I try to use \usepackage[libertine]{newtxmath} and have an equation with boldsymbol, this message appears:

Font shape OT1/txr/sb/n' undefined(Font) usingOT1/txr/m/n' instead

Is there something wrong with this? What can I do to solve this?

Thank you!

2

According to the documentation, load bm after all math packages to get bold math, and use \bm. The package also supports \mathbf for bold upright text in math mode. This appears to be caused by the way bm sets up \mathbf.

Here is a slight modification of an example from the manual:

\usepackage[lining,semibold,type1]{libertine} % a bit lighter than Times--no osf in math
\usepackage[T1]{fontenc} % best for Western European languages
\usepackage{textcomp} % required to get special symbols
\usepackage[varqu,varl]{inconsolata}% a typewriter font must be defined
\usepackage[libertine,vvarbb]{newtxmath}
\usepackage[scr=rsfso]{mathalfa}
\usepackage{bm}% load after all math to give access to bold math

I added the type1 option to libertine to prevent the package from loading the Unicode font through fontspec on LuaLaTeX or XeLaTeX. You could load it after bm to use the fontspec definition of \mathbf, but then upright capital Greek letters would break, because newtx looks for those in the seven-bit OT1 encoding. There are other workarounds, but this is the simplest.

In the modern toolchain, you can instead load \usepackage{libertinus} to get the Libertinus Math font, or unicode-math followed by \setmathfont{Libertinus Math}. This enables the legacy \mathbf (for bolded words), and the new commands \symbfup and \symbfit for letters and numbers. You can still use \boldsymbol,\boldmath and \mathversion{bold} to get symbols from Libertinus Math Bold. (You can thank Khaled Hosny for being one of the only font designers who makes bold OpenType math fonts.)

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.