[XeTeX] \meaning on a \csname \let to a character

Khaled Hosny khaledhosny at eglug.org
Mon Jan 7 18:39:47 CET 2013


On Sun, Jan 06, 2013 at 10:50:51PM +0000, David Carlisle wrote:
> I'm trying to update the bm package to work with xetex (and luatex,
> but concentrating on xetex for now) and in particular to work with
> unicode-math package.
> 
> 
> bm needs to look at each token (after expansion) and if it is a
> character look up the mathcode and construct a suitable bold
> replacement.
> 
> It turns out that bm had a bug since the start that if you go
> 
> \let\qchar=q
> 
> ...
> 
> \bm{\qchar}
> 
> It failed (because it was trying to use \count@=`\qchar and the
> backtick does not work in that context)
> 
> This bug isn't too important in classic TeX (I don't think anyone ever
> reported it since the first version of bm in 1996:-)  However after
> unicode-math this is rather more serious as many more command names
> are \let to character tokens.
> 
> The only way I can see to fix this in bm is to use \meaning to get
> from \qchar to "the letter q" then strip away the "the letter "
> getting the explict character q so I can use `q to look up the
> mathcode.
> 
> this seems OK in pdftex or luatex but in xetex I hit
> 
> \bm{\alpha}
> 
> \alpha expands to \mitalpa but \meaning\mitalpha  is
> 
> the letter ???
> 
> with ascii ? so I can't access the explicit alpha character.

This is already fixed in the development version, it now returns:

  the letter number "1D6FC

(which was triggered by the TeX.SE question:
http://tex.stackexchange.com/q/62725/729)

> Would it be possible for xetex to return the actual character in
> \meaning (and \show) or if not is there any way to access the mathcode
> (\XeTeXmathcodenum) of an implict character token?

I don't think there is, but I don't understand all the macro code side
of things, so I may be wrong.

Regards,
khaled


More information about the XeTeX mailing list