8

When using the libertine package together with newtxmath and pdflatex, the equality and minus glyphs in math mode are not taken from the libertine font which results in too large symbols compared to other symbols like the "plus" operator, which is correctly taken from the libertine font. Furthermore, in math mode, the wrong glyphs are of a totally different shape (straight caps instead of round caps like the "plus" sign).

Minimal working example:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

\begin{document}\noindent
  Text: a = b + c \textminus{} d \\
  Math: $a = b + c - d$
\end{document}

text vs. math mode

Text mode uses (of course) correct glyphs, math mode does not.

Edit: Please note that in the above example I provide the formula in text mode only in order to demonstrate that the correct glyphs are available in the libertine font. Of course, I always use math mode for writing equations, etc.

Is this behavior a bug in the newtxmath package or is it supposed to work like that? Is there a possibility to change individual glyphs (like = and –)?

  • after loading libertine and newtxmath you may try \usepackage[italic]{mathastext}. This way the =, +, and - will be as in the text. – user4686 Jun 1 '13 at 22:16
  • \usepackage[italic,defaultmathsizes]{mathastext} will tell mathastext not to increase the subscript and superscript sizes in math. – user4686 Jun 2 '13 at 7:03
  • I would avoid "text math" altogether, and always use math mode for equations etc. That way, it is at least consistent. – mafp Jun 2 '13 at 22:51
  • @mafp: Of course, I always use math mode for equations. I just provided the formula in text mode as well to show that the correct glyphs are available in the libertine font. – Bloops Jun 3 '13 at 8:47
  • So was my answer any help for you? – mafp Jun 6 '13 at 23:32
4

Yes, this seems to be the intended behaviour of newtxmath. The reason is simple: while you could get a few mathematical symbols from the Libertine fonts like = and -, most mathematical symbols are not covered. What you want would end up with a mixture of a few math symbols taken from Libertine and most other math symbols given by newtx.

However, the situation is strange: in your MWE the math version does use the + from Libertine while = and - are taken from ntxmia and ntxsy, i.e., from newtx. I can see in the newtx code that = is explicitly taken from ntxmia, but I can't see why - is taken from newtx and + from Libertine. I guess the reason is that there is a + in the OT1 encoding, but no -.

Anyway, you can replace the two offending symbols with Libertine's symbols like that:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

%% change equal sign from U/ntxmia/m/it "3D to OT1/LinuxLibertineT-TLF/m/n "3D
\DeclareSymbolFont{libtext}{OT1}{LinuxLibertineT-TLF}{m}{n}
\DeclareMathSymbol{=}{\mathrel}{libtext}{"3D}

%% change minus sign from OMS/ntxsy/m/n "00 to TS1/LinuxLibertineT-TLF/m/n "3D
\DeclareSymbolFont{libtextsymb}{TS1}{LinuxLibertineT-TLF}{m}{n}
\DeclareMathSymbol{-}{\mathbin}{libtextsymb}{"3D}


\begin{document}
  \noindent
  Text: a = b + c \textminus{} d \\
  Math: $a = b + c - d$
\end{document}

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.