[XeTeX] Fontspec 1.8 problem?
Ross Moore
ross at ics.mq.edu.au
Tue Jul 19 06:35:23 CEST 2005
On 18/07/2005, at 9:45 PM, Will Robertson wrote:
> On 18 Jul 2005, at 9:20 AM, Ross Moore wrote:
>
>
>> More cleanly would be coding as follows:
>>
>> \bgroup
>> \mathchardef\testcolon="603A %
>> \let\next\egroup
>> \ifx\colon \testcolon
>> \def\next{\egroup\noexpand\DeclareMathSymbol{:}{\mathpunct}
>> {legacymaths}{"3A}}%
>> \fi
>> \next
>>
>
> By the way, I just checked and was surprised to find that
> \DeclareMathSymbol works globally,
Yes; ultimately it calls either
\global\mathchardef .....
or \global\mathcode ....
to establish the required definitions.
However, there is a bit more to it, concerning testing
whether the mathversion (in this case 'legacymath')
exists to handle the definitions.
I've not checked exactly how this works, so I'd prefer
to have all the \DeclareMathSymbol commands made at the
same (outer) level.
BTW, there's a slight error in my coding.
It should be either:
\edef\next{\egroup\noexpand\DeclareMathSymbol{:}{\noexpand
\mathpunct}{legacymaths}{"3A}}%
or (OK simpler version):
\def\next{\egroup\DeclareMathSymbol{:}{\mathpunct}{legacymaths}{"3A}}%
> so "breaking out of the shield" isn't necessary...
>
But I've just realised that we really should be wary of the possibility
that a package may have changed the category code of " .
Bearing in mind the math-version testing, the coding should become:
\bgroup
\catcode`\" 12
\mathchardef\testcolon="603A %
\let\next\egroup
\ifx\colon \testcolon
\edef\next{\egroup\noexpand\DeclareMathSymbol{:}{\noexpand
\mathpunct}{legacymaths}{"3A}}%
\fi
\next
Cheers,
Ross
> Will
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
------------------------------------------------------------------------
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