# [lltx] LuaLaTeX and the unicode-math package

Khaled Hosny khaledhosny at eglug.org
Wed May 16 19:26:34 CEST 2012

On Wed, May 16, 2012 at 06:30:27PM +0200, Andrea del Monaco wrote:
>
>     \DeclareMathAlphabet is broken with unicode-math package, depending on
>     how your fonts for the new alphabet are setup, it might be possible to
>     do it with some low level trickery.
>
> such as...?
> I was thinking something like
> \newcommand\mathbbbf{\text{\fontspec[some options]{some font} #1}}
> Do you have something else in your mind?

I was thinking much lower level, using \fam and stuff, but thinking
again about it I don't think this will work.

>     > 2) modifying some ranges (for example I just want to use XTIS Math's
>     latin
>     > alphabet but with Asana Math's greek alphabet).
>     > I can't do that using only the declaration
>     > \setmathfont[range=greek]{Asana-Math.otf}
>     > because otherwise it will take so much time...
>
>     There is no such option, you have to list all alphabets manually:
>
>      range={\mathup/{greek,Greek}, \mathit/{greek,Greek}}
>
>
> I'm not been able to find such an explanation in the package documentation of
> unicode-math...
> And what about unicode codes?
> Should [range=1D501], [range=1D501-1D52C] will work? Or do I have to specify
> something as before?
> Because the second case causes the same problems as the previous range=greek.

It should be "1D501-1D52C, check section 4.1 of the documentation.

>     I don't understand the question, can you elaborate on what you want to
>     do? If you are looking for the equivalent of \char in math mode, it is
>     \Umathchar.
>
> And how \Umathchar works?
> It takes three argumentes, right?
> The first one is the type of math symbol, the latter is the unicode of the
> glyph, and the second one is (according to the XeTeX reference guide) "is a
> number (0–255) representing font to use in maths".
> Now: what does it means the last statement?

The number is the math font family, every math font is assigned a family
number, it is very low level stuff:

\ExplSyntaxOn
\fontspec_set_family:Nnn \l_my_family_tl
{} % font options, should be fine for simple symbols
{XITS Math}
\DeclareSymbolFont{MyFont}      {\encodingdefault}{\l_my_family_tl}{\mddefault}{\updefault}
\SetSymbolFont    {MyFont}{bold}{\encodingdefault}{\l_my_family_tl}{\bfdefault}{\updefault}
\ExplSyntaxOff

$\luatexUmathchar "6 \symMyFont "1D6FC$

Regards,
Khaled