[XeTeX] Fontspec 1.8 problem?

Ross Moore ross at ics.mq.edu.au
Mon Jul 18 01:50:05 CEST 2005


Hi Will,

On 16/07/2005, at 8:09 PM, Will Robertson wrote:

> On 16 Jul 2005, at 7:21 PM, Ross Moore wrote:
>
>
>> If you really want to override the existing definition,
>> then isn't it a better fix to:
>>
>>  \let\colon\relax
>>  \DeclareMathSymbol{\colon}{\mathpunct}{legacymaths}{"3A}
>>
>
> Well, I'm not sure. It would be a better idea, but I wasn't really  
> sure what was going with amsmath's definition:

Sure; that's why I started my comment with 'If' and phrased
it as a question.

>
>   \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript
>     \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}

This is affecting white-space around the colon character, presumably
for function-notation, such as  $f\colon A\to B$  (for  f:A-->B )

It prevents a line-break before the : and allows some stretchability
afterwards.

>
> Since the point of overwriting this in fontspec is  
> \AtBeginDocument, I didn't really want to override the effort that  
> went into this macro...

Yes, I would normally agree.
But \colon is predefined with  \mathchardef\colon="603A .
which is the kind of thing that  fontspec  wants to replace, yes ?

Perhaps a good way to handle this is by first testing what \colon
currently represents:

\mathchardef\testcolon="603A
\ifx\colon \testcolon
   \DeclareMathSymbol{:}{\mathpunct}{legacymaths}{"3A}
\fi


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


>
> So I figure anyone using \colon is *probably* using amsmath, and in  
> that case I wouldn't want fontspec

No;  \colon  is part of Plain TeX too, so of ordinary LaTeX without AMS.
AMS just redefined how it would work with respect to white-space and  
line-breaks.

> changing their documents from how they expect. The corollary to  
> this being that the lucida maths setup probably is being a little  
> over-enthusiastic in providing macros for its glyphs and anyone  
> wanting a colon will be using instead:
>
>   \DeclareMathSymbol{:}{\mathrel}{legacymaths}{"3A}

\mathrel ???  or  \mathpunct .

>
> Am I barking up the wrong tree?

Won't the AMS definition still work fine, unchanged ?
Surely the ':' will come from the correct font in XeTeX ,
or am I misunderstanding what you are doing with  fontspec ?

In this case, you only want to change the expansion of \colon
when it has its default established using  \mathchardef .

Maybe this is true for other symbols too, so my testing code
above could have greater applicability ?



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