[XeTeX] XeTeX: ready for full-time math?

Ross Moore ross at ics.mq.edu.au
Wed Aug 23 05:50:30 CEST 2006

Hi Jonathan,

Your responses in this email have been extremely helpful
to me.

On 22/08/2006, at 7:43 PM, Jonathan Kew wrote:

> On 22 Aug 2006, at 4:59 am, Ross Moore wrote:

> Not currently; at this level, you're directly addressing the UTF-16
> codes that are used to represent Unicode text during processing. So a
> Plane 1 character could be represented as a surrogate pair (two
> ^^^^xxxx codes), but that's not a single token; it's two.

Use of surrogate pairs is a good tip; thanks,
and to the earlier poster who also suggested this.

>> e.g.,  mathematics needs to access Plane-1
>>    U+1D515   (fraktur R)
> (Oops.... fraktur R is actually U+211C, and U+1D515 is unassigned!
> But that's incidental to the point, of course.)

Right. (on both counts :-)
Code2001 has a few plane-0 characters, such as this,
which would fit naturally into the (unassigned) Plane-1 slot.

Barbara Beeton's STIX tex macros refer to the Plane-1 position,
as well as the Plane-0. This complicates the preparation
of automatic meta-macros for declaring tex-names and getting
the appropriate characters.
That's what I'm currently working on.

> And this is what you can't (currently) do. The \catcode table (along
> with \lccode, \uccode, \sfcode, and \mathcode) contains values for
> the UTF-16 code values (i.e., "0000 ... "FFFF), so you can't make a
> non-Plane 0 character \active, for instance.
> I could consider extending this to fully support higher planes, but
> my question would be whether this is really needed. Do we expect to
> see *input* text that uses the Plane 1 math characters directly? I
> would have thought it more likely that they will either be
> represented by markup (e.g., MathML entities from some authoring
> system, which could map to TeX control sequences like \frakR), or
> keyed as plain ASCII letters that are intended to appear in a
> particular style/family that maps to Plane 1 characters in a Unicode
> math font.

But there are more than just math-characters in Plane-1.

However, maths is special in that you have the concept of
math-family, which determines spacing within a formula.

Thus using a character requires more than just what the
font provides, hence the need for active characters.

Is this concept appropriate beyond the maths context?
Maybe not. But see further comments below ...

> I think it's possible to define such active characters by other
> approaches, though, such as by making use of \lccode changes to get
> to the character you want. E.g., something along the lines of
> (untested):
>    \def\DeclareActiveMathCharacter#1#2#3{%
>      \def#2{\ensuremath{\text{#3{\char"#1}}}}%
>      \count255=\lccode`\~ % assuming ~ is active
>      \lccode`\~="#1 \lowercase{\let~#2}%
>      \lccode`\~=\count255
>    }
> Here, #1 will currently be limited to FFFF, of course, because there
> are no \catcodes or \lccodes beyond this.

Thanks. I needed this anyway, for the Plane-0 characters.

> That's my question
> (above).... do people really feel a need for these? Will
> supplementary-plane math letters become commonplace *as literal
> characters in input text*? Comments invited!

Whether we *really* need them or not, is not really the issue,
as I see it.

As we use these higher-plane characters in typeset PDFs,
and elsewhere, people will want to copy/paste from them
into the source for other (Xe)TeX documents.

Future PDF-reader software will provide UTF16, or whatever,
and may not use surrogate pairs. In any case, the average user
will neither know what they are getting, nor care.
They'll just want it to work --- and why not?

Indeed, provided an appropriate CMAP has been installed into
the PDF, this might even be doable by Preview now.

If TeX software cannot handle the result of such copy/paste,
then what software will the user blame, and stop using ???

So do we really have any choice about this?

> JK



Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114

More information about the XeTeX mailing list