latex3 / unicode-math

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

Regression: Missing character: There is no ^^@ in font #351

Closed gadmm closed 6 years ago

gadmm commented 8 years ago

The following example

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{xits-math.otf}
\setmathfont[range={\rightarrow}]{Latin Modern Math}
\begin{document}
$\left(\right.$
\end{document}

triggers the following error with XeLaTeX:

Missing character: There is no ^^@ in font LatinModernMath-Regular/OT:script=ma

The problem appears for any range specification and for many fonts replacing Latin Modern Math.

The bug appeared after upgrading to Ubuntu 16.04 and still present in unicode-math 2015/09/24 v0.8c. It causes documents which used to compile not to compile anymore (notably with lyx, which stops the compilation when such errors are found).

wspr commented 8 years ago

Thanks, this is obviously a pretty serious bug. I’ll do my best to get a fix out ASAP.

gadmm commented 8 years ago

I found a workaround for now, which is to have a working font in the last call to setmathfont, e.g.

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{xits-math.otf}
\setmathfont[range={\rightarrow}]{Latin Modern Math}
\setmathfont[range={\dummysymbol}]{xits-math.otf}
\begin{document}
$\left(\right.$
\end{document}

where \dummysymbol is a symbol I want in XITS anyway

gadmm commented 8 years ago

I noticed this has to do with the empty delimiter. If you write $\left.\right.$ then you have the error twice.

eg9 commented 8 years ago

This seems much related to http://tex.stackexchange.com/questions/154001/ and the fact that \setmathfont can change the delcode of the period. It seems to happen nonetheless in XeLaTeX and only with range specified with LuaLaTeX.

The following test file

\documentclass{article}
\usepackage{unicode-math}

\showthe\Udelcodenum`.

\setmathfont{XITS Math}

\showthe\Udelcodenum`.

\setmathfont[range=\int]{Latin Modern Math}

\showthe\Udelcodenum`.

\stop

shows, with XeLaTeX,

> 0.
l.4 \showthe\Udelcodenum`.

? 
> 1073741824.
l.8 \showthe\Udelcodenum`.

? 
> 1082130432.
l.12 \showthe\Udelcodenum`.

and, with LuaLaTeX,

> 0.
l.4 \showthe\Udelcodenum`.

? 
(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache/generic/fonts/otl/xit
s-math.luc)(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache/generic/fo
nts/otl/xits-mathbold.luc)
> 0.
l.8 \showthe\Udelcodenum`.

? 
(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache/generic/fonts/otl/lat
inmodern-math.luc)
> 4194304.
l.12 \showthe\Udelcodenum`.
ghost commented 7 years ago

Possible manifestation of the same bug in xelatex + elsarticle + “Asana Math” + \right. = ↯ :

\documentclass{elsarticle}
\usepackage{unicode-math}
\setmathfont[range={\setminus}]{Asana Math}
\begin{document}
\(\left( \right.\)
\end{document}