latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
246 stars 29 forks source link

Spurious space after \bigl( #357

Closed eg9 closed 8 years ago

eg9 commented 8 years ago

The following example shows a spurious space after \bigl( when compiled with XeLaTeX, but not with LuaLaTeX

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\setmathfont[range=\mathbb]{TeX Gyre Pagella Math}
\setmathfont[range=\int]{Latin Modern Math}
\begin{document}
$\bigl(($
\showoutput
\end{document}

The relevant part of the log is, with XeLaTeX,

....\mathon
....\hbox(8.5+2.97)x7.02
.....\mathon
.....\hbox(8.5+2.97)x7.02
......\vbox(7.97+2.97)x4.22
.......\l_fontspec_font glyph#2367
......\vbox(8.5+0.0)x0.0
......\vbox(0.0+0.0)x2.8, shifted -2.5
.......\l_fontspec_font glyph#0
.....\mathoff
....\l_fontspec_font glyph#9
....\mathoff

whereas, with LuaLaTeX, it is

....\mathon
....\hbox(8.5+2.97)x4.22, direction TLT
.....\mathon
.....\hbox(8.5+2.97)x4.22, direction TLT
......\hbox(7.97+2.97)x4.22, direction TLT
.......\l_fontspec_font 󰙇
......\vbox(8.5+0.0)x0.0, direction TLT
......\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT
.....\mathoff
....\l_fontspec_font (
....\mathoff

and the space is evident in

\vbox(0.0+0.0)x2.8, shifted -2.5

with XeLaTeX, versus

\hbox(0.0+0.0)x0.0, shifted -2.5, direction TLT

with LuaLaTeX.

The space does not show if the math font declarations are removed when the \vbox is again \hbox also in XeLaTeX.

If I add \tracingmacros=1, I get, when compiling with XeLaTeX,

\n@space ->\nulldelimiterspace \z@ \m@th 

\m@th ->\mathsurround \z@ 
Missing character: There is no ^^@ in font LatinModernMath-Regular/OT:script=math;language=DFLT;!

hinting for a spurious character somewhere.

eg9 commented 8 years ago

Noticed it's the same as #351