[XeTeX] Math class initialization in Unicde-aware engine
Doug McKenna
doug at mathemaesthetics.com
Thu Nov 28 02:26:42 CET 2019
Ross wrote:
>| If by ignoring you mean removing the character entirely, then that is surely not best at all.
>|
>| Most N Class (Normal) characters would be simply of the default \mathord class.
The parsing code in load-unicode-math-classes.tex installs values in the \Umathcode table that comport with some rule, which without too much of a close look seems to me to be whether the character code math class read from MathClass.txt is one of the eight possibilities that parsing code pays attention to, out of the 15 possible ones in the file. Therefore it appears to me that all entries in MathClass.txt that are marked with, for instance, 'N', are ignored with respect to installing any entry in the \Umathcode table.
It may be that such characters in MatClass.txt marked with 'N' take on the \mathOrd attribute by default when TeX finds them within math mode, I'm not sure without looking at its code.
Doug McKenna
From: "Ross Moore" <ross.moore at mq.edu.au>
To: "xetex" <xetex at tug.org>
Sent: Wednesday, November 27, 2019 5:16:44 PM
Subject: Re: [XeTeX] Math class initialization in Unicde-aware engine
Hi Joe, Doug
On 28 Nov 2019, at 10:27 am, Joseph Wright < [ mailto:joseph.wright at morningstar2.co.uk | joseph.wright at morningstar2.co.uk ] > wrote:
BQ_BEGIN
> # N - Normal - includes all digits and symbols requiring only one form
BQ_END
BQ_BEGIN
> # D - Diacritic
BQ_END
BQ_BEGIN
> # F - Fence - unpaired delimiter (often used as opening or closing)
BQ_END
BQ_BEGIN
> # G - Glyph_Part - piece of large operator
BQ_END
BQ_BEGIN
> # S - Space
> # U - Unary - operators that are only unary
BQ_END
BQ_BEGIN
> # X - Special - characters not covered by other classes
BQ_END
BQ_BEGIN
> Unfortunately, the documentation/comments don't say what happens to entries having these other Unicode math codes (N, D, F, G, S, U, and X). Are they completely ignored, or are they mapped to one of the other eight codes that matches what TeX is interested in or only capable of handing?
>
> I can imagine that the space character, given Unicode math class 'S' in MathClass.txt, is ignored during this parse. But what happens to the '¬' character (U+00AC) ("NOT SIGN"), which is assigned 'U' (Unary Operator). Surely the logical not sign is not being ignored during initialization of a Unicode-aware engine, yet the comments in load-unicode-math-classes.tex don't say one way or the other, and it appears to me that the parsing code is ignoring it.
BQ_END
BQ_BEGIN
The other Unicode math classes don't really map directly to TeX ones, so
they are currently ignored. Suggestions for improvements here are of
course welcome.
BQ_END
If by ignoring you mean removing the character entirely, then that is surely not best at all.
Most N Class (Normal) characters would be simply of the default \mathord class.
I’d expect others to be mapped instead into a macro that corresponds to something that TeX does support.
e.g.
space characters for thinspace, 2-em space, etc. in U+2000 – U+200A
can expand into things like: \, \; \> \quad \qquad etc. ( even to constructions like \mskip1mu )
After all, this is essentially what happens when pdfTeX reads raw Unicode input.
The G class (Glyph_Part) is a lot harder, as those glyph parts don’t correspond to any single
TeX macro. Think about a very large opening brace spanning 3+ ordinary line widths, say,
as may be generated by \left\{ ... \right\} surrounding some (inner-) displayed math alignment.
On input, the whole grouping would need to be identified and mapped to appropriate TeX coding.
Basically there is a lot here that needs to be looked more or less individually.
I’ve been through this kind of exercise, in reverse, to decide what to specify as /Alt and /ActualText
replacements (for accessibility) for what TeX produces with various math constructions.
I don’t have definitive answers for everything, but have tried some possibilities for many things.
BQ_BEGIN
Joseph
BQ_END
Hope this helps.
Ross
Dr Ross Moore
Department of Mathematics and Statistics
12 Wally’s Walk, Level 7, Room 734
Macquarie University, NSW 2109, Australia
T: +61 2 9850 8955 | F: +61 2 9850 8114
M:+61 407 288 255 | E: [ mailto:ross.moore at mq.edu.au | ross.moore at mq.edu.au ]
[ http://www.maths.mq.edu.au/ | http://www.maths.mq.edu.au ] [ http://mq.edu.au/ |
CRICOS
Provider Number 00002J. Think before you print.
Please
consider the environment before printing this email.
This
message is intended for the addressee named and
may
contain
confidential information. If you are not the intended
recipient,
please delete it and notify the sender. Views expressed
in
this message are those of the individual sender, and are
not
necessarily
the views of Macquarie University. ]
[ http://mq.edu.au/ ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/xetex/attachments/20191127/548891ee/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4605 bytes
Desc: image001.png
URL: <https://tug.org/pipermail/xetex/attachments/20191127/548891ee/attachment-0001.png>
More information about the XeTeX
mailing list