# why does newtxmath fail to work with pdflatex and libertine

There seems to be some sort of incompatibility between the newtxmath package and libertine-legacy; the following code fails to compile:

 \documentclass{article}
\usepackage[libertine]{newtxmath}
\begin{document}
$a = 1$
\end{document}


when compiled through pdflatex, as it results in latex trying to find a Libertine-nu font which doesn't seem to exist:

kpathsea: Running mktextfm Libertine-nu
/usr/local/texlive/2012/texmf/web2c/mktexnam: Could not map source abbreviation L for Libertine-nu.
/usr/local/texlive/2012/texmf/web2c/mktexnam: Need to update /usr/local/texlive/2012/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input Libertine-nu


I installed the latest version of the package from: http://mirrors.ctan.org/install/fonts/libertine-legacy.tds.zip today, and haven't tried this before so don't know if it's a recent breakage or not.

I'd prefer to continue using pdflatex because the microtype package that doesn't seem to work well with lualatex or xelatex yet. Changing the package over to use the libertineotf package and compiling with xelatex does work.

-
Please file a bug report to the author of newtx, who is usually very responsive. –  egreg Oct 24 '12 at 23:34

I assume you are using the latest version of the newtx package, which comes with its own (stripped down) version of the Libertine font. Unfortunately, there's a small packaging error: The Libertine-nu.tfm file has the wrong case. Changing

 /usr/local/texlive/2012/texmf-dist/fonts/tfm/public/newtx/libertine-nu.tfm 

to

 /usr/local/texlive/2012/texmf-dist/fonts/tfm/public/newtx/Libertine-nu.tfm 

should do the trick.

-
I would never have thought of that! Running mktexlsr (also known as texhash) is necessary after having changed the name. Are Libertine-nu and LibertineZI-nu different? –  egreg Oct 25 '12 at 10:41
LibertineZI-nu is a semibold italic variant and Libertine-nu the default medium variant –  Herbert Oct 25 '12 at 12:23
yes. Thanks, that seems to work for me! –  Sam Mason Oct 26 '12 at 8:58

It's a very obscure bug indeed. I traced it in the nxlmia.vf virtual font file.

If one runs vftovp $(kpsewhich nxlmia.vf) from a Bash shell, the output will read (VTITLE ) (FAMILY UNSPECIFIED) (FACE F MRR) (CODINGSCHEME FONTSPECIFIC) (DESIGNSIZE R 10.0) (COMMENT DESIGNSIZE IS IN POINTS) (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) (CHECKSUM O 24175074123) (SEVENBITSAFEFLAG TRUE) (FONTDIMEN (SLANT R 0.0) (SPACE R 0.25) (STRETCH R 0.3) (SHRINK R 0.1) (XHEIGHT R 0.478) (QUAD R 1.0) (EXTRASPACE R 0.06) ) (MAPFONT D 0 (FONTNAME rfxlr-alt) (FONTCHECKSUM O 30127131230) (FONTAT R 1.0) (FONTDSIZE R 10.0) ) (MAPFONT D 1 (FONTNAME Libertine-nu) (FONTAT R 1.0) (FONTDSIZE R 10.0) ) (MAPFONT D 2 (FONTNAME txmia) (FONTCHECKSUM O 4141071701) (FONTAT R 1.0) (FONTDSIZE R 10.0) ) [...]  and the bug shows in the instruction MAPFONT D1, where the requested font is the inexistent Libertine-nu. All the other virtual fonts that need it call instead LibertineZI-nu which exists. ## A temporary fix Run from a Bash shell cp$(kpsewhich libertine-tfm) Libertine-nu.tfm
vftovp \$(kpsewhich nxlmia.vf) > nxlmia.vpl


Run

vptovf nxlmia.vpl


and keep the resulting file nxlmia.tfm and nxlmia.vf in the same directory as the document you're working on along with Libertine-nu.tfm

If you are bold enough you can move the two files to replace those provided by TeX Live (or MiKTeX). When newtx will be updated to correct the issue, there will not be anything to do, other than removing the three files.

-