2

I have trouble with the spacing around integral signs while using newtxmath and libertine. The integral sub-/superscripts are to far off the integral sign.

enter image description here

I took the same example TEX code as in this posting: mathabx integral sign in newtxmath style:

\documentclass{article}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{amsmath}
\usepackage{esint}

\begin{document}

This is almost trivial to prove:
\begin{equation*}
\int_{-\infty}^{\infty}e^{-x^{2}}\,dx=\sqrt{\pi}
\end{equation*}
And here are the other integral symbols:
\begin{equation*}
\int\quad\iint\quad\iiint\quad\oint\quad\oiint
\end{equation*}
\end{document}

I am using TeXLive with Debian stable. This is coming with "newtxmath 2014/09/28 v1.29". I also tried "newtxmath 2016/08/12 v1.5" like with this screenshot. There is no difference.

What is going wrong?

Thanks for your help,
Matthias

2
  • With TeX Live 2016 (fully updated), I can't reproduce the issue.
    – egreg
    Commented Aug 26, 2016 at 8:43
  • I realized that this is a lualatex issue. With pdflatex the spacing is fine. I compared pdfTeX, Version 3.14159265-2.6-1.40.15 with LuaTeX, Version beta-0.79.1, both from TeX Live 2015/dev/Debian. That is a bug. Where should I report that? Commented Aug 26, 2016 at 16:41

2 Answers 2

4

Load fontspec with the no-math option to avoid that it resets math fonts at the begin of the document:

\documentclass{article}
\usepackage[no-math]{fontspec}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{amsmath}
\usepackage{esint}

\begin{document}

This is almost trivial to prove:
\begin{equation*}
\int_{-\infty}^{\infty}e^{-x^{2}}\,dx=\sqrt{\pi}
\end{equation*}
And here are the other integral symbols:
\begin{equation*}
\int\quad\iint\quad\iiint\quad\oint\quad\oiint
\end{equation*}
\end{document}

enter image description here

Addition

After a big digging around I think the source of the wrong spacing is that the open type linux libertine has a so-called mathconstants table. Loading such a font in math changes quite a number of math related dimensions (this is documented in the luatex manual) but seems also to change the way how the super-/subscripts are placed even if legacy math fonts are used. I'm not sure if this is intended and I asked a question on the luatex list about it. The problem can be demonstrated e.g. with Cambria Math too:

\documentclass{article}
\usepackage[no-math]{fontspec}

\setsansfont{Cambria Math}
\DeclareMathAlphabet      {\mathtest}{EU2}\sfdefault\mddefault\updefault

\begin{document}

$\mathtest{abc}$

\[
\int_{-\infty}^{\infty}a
\]

\end{document}

enter image description here

0

This is a fonts issue. pdflatex is using type1 fonts (like /usr/share/texlive/texmf-dist/fonts/type1/public/libertine/L‌​inLibertineT.pfb) while lualatex is using opentype (like /usr/share/fonts/opentype/linux-libertine/LinLibertine_R.ot‌​f). When I force type1 fonts in lualatex with \usepackage{libertine-type1} the output is correct.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .