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

David Carlisle d.p.carlisle at gmail.com
Sun Jan 6 23:50:51 CET 2013


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.

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?

Thanks

David

(I'm signed up to the list so (hopefully:-) replies to list will reach me)






--
http://dpcarlisle.blogspot.com/


More information about the XeTeX mailing list