latex3 / unicode-math

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

“Missing number, treated as zero” for some symbols in range (e. g. \nabla) #441

Closed Socob closed 6 years ago

Socob commented 6 years ago

Description

The range option seems to produce errors when some symbols are specified, but not for others. For example, range=\int seems to work, but range=\nabla or range=\partial produces the error “Missing number, treated as zero”.

Check/indicate

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{latinmodern-math.otf}
% problematic:
\setmathfont{texgyrepagella-math.otf}[range=\nabla]
% not problematic:
\setmathfont{texgyrepagella-math.otf}[range=\int]
\begin{document}
    \[
        ∫∇
    \]
\end{document}

Further details

Errors in the log:

! Missing number, treated as zero.
<to be read again> 
\g__um_named_slots_scr_latin_clist 
l.5 ...thfont{texgyrepagella-math.otf}[range=\nabla]

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Missing number, treated as zero.
<to be read again> 
\g__um_named_slots_bfscr_latin_clist 
l.5 ...thfont{texgyrepagella-math.otf}[range=\nabla]

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

Note that the number of these errors increases drastically if the line \setmathfont{latinmodern-math.otf} is omitted.

This is in unicode-math v0.8k, but did not happen in unicode-math v0.8f.

wspr commented 6 years ago

Hmmf. That shouldn’t happen, of course :) unicode-math now tries to screen out symbols it doesn’t recognise (try with range=\section, say) but here there’s clearly something getting in the way of the symbol → slot number mapping.

Unfortunately I can’t look into this until I have some grants out of the way… sorry for the trouble.

wspr commented 6 years ago

I got side-tracked. This was easier to work around than I expected.