# spacing in LuaLaTeX with unicode-math

I would like to use LuaLaTeX with unicode-math to use some OTF math font, but when I switch on unicode-math the spacing in integrals looks bad. Compare the result with the legacy Computer Modern Math font

\documentclass{article}
\begin{document}
$\int_{-A}^{B} dx$
\end{document}


with OTF Latin Modern Math

\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$\int_{-A}^{B} dx$
\end{document}


\setmathfont{XITS Math} looks even worse

Is there a problem with my installation (fully upgraded TeX Live 2016 on linux, luatex -v gives Version 0.95.0) or this is the best that I should expect with unicode-math?

• I seem to remember there were some bugs in this area, I get this image with xits-math with luatex 1.0.2 (and everything else from current texlive 2016) Feb 6, 2017 at 21:20
• You can also use xelatex of course which should produce better output than you show. Feb 6, 2017 at 21:21
• Unfortunately, it's a long standing bug in LuaTeX Feb 6, 2017 at 21:26
• @egreg you don't get what I show in the first comment? Feb 6, 2017 at 21:32
• @Marco: I use ConTeXt minimals, which typically includes the latest binary of luatex. Feb 7, 2017 at 1:59

Luatex had some bugs in this area but using luatex 1.0.2 (as will go into texlive 2017, or may be built from source) I get

using

\setmathfont{XITS Math}


You can also get essentially the same output using xelatex if that is an option.

• Is there any chance at all that LuaTeX 1.0.2 will be distributed with TeXLive2016 and MacTeX2016? (Please, please, cherry on top?)
– Mico
Feb 6, 2017 at 21:46
• @Mico Not down to us but 'very likely no': you can get builds from W32TeX/ConTeXt minimals which work with TeX Live Feb 6, 2017 at 21:48
• David: Where is the git master (or equivalent) source code for LuaTeX? The project page only provides release versions, as far as I can tell. I can compile on Ubuntu 16.04 and regularly do that for GIMP dev version. I wouldn't mind trying LuaTeX 1.0.2 installed in /opt if possible.
– user103221
Feb 6, 2017 at 21:53
• you can get the texlive svn but actually I built off luatex experimental branch, svn info says it comes from URL: foundry.supelec.fr/svn/luatex/branches/experimental Relative URL: ^/branches/experimental Repository Root: foundry.supelec.fr/svn/luatex Feb 6, 2017 at 21:55
• @Marco copy the luatex from your texlive bin directory (just in case) and then copy the context one in to place, then run fmtutil-sys to rebuild the formats. the executable will detect its location and default to picking up the texlive 2016 paths Feb 6, 2017 at 23:40