[lltx] unicode-math: [range=…] in-document

Ulrike Fischer news3 at nililand.de
Wed Sep 21 14:29:58 CEST 2011

Am Wed, 21 Sep 2011 12:17:50 +0200 schrieb Arno Trautmann:

> Hi all,
> the following document throws an error:
> \documentclass{minimal}
> \usepackage{unicode-math}
> \setmathfont{Latin Modern Math}
> \begin{document}
> \setmathfont[range=\oiint]{XITS math}
> \[ ∫ \oiint\]
> \end{document}
> ./test.tex:7: Missing number, treated as zero.
> <to be read again>
>                     \oiint
> l.7 \setmathfont[range=\oiint]{XITS math}
> ?
> It works fine if the second \setmathfont is in the preamble. (I want to 
> change the math font for some glyphs only in the document, so I cannot 
> put it in the preamble.)
> Is it not possible in prinicple to load a range of a math font 
> in-document or is it a bug? Maybe something with parsing 
> numbers/arguments in the preablem vs. in-document?

At \begin{document} unicode-math setups the various math
definitions, such definitions can be quite complicated and so you no
longer can't use the commands as numbers. That's not very surprising
(actually I find it quite impressing that you can use them this way
in the preamble). 

But you can use in the document numbers:

\setmathfont{Latin Modern Math}
\[\plus \oiint \]
\setmathfont[range={"0002B, "0222F}]{XITS math}
\[\plus \oiint \]

(you can find the numbers in unicode-math-table.tex).

Ulrike Fischer 

More information about the lualatex-dev mailing list