[XeTeX] Using the Unicode prime character (Was re. Single glyphs from a font)

Joel C. Salomon joelcsalomon at gmail.com
Tue Jun 9 16:32:48 CEST 2009


Ross,

Thanks for all the help here.

>>> Now even this works:    \tag{$\ref{abc}'$}
>>> using the ordinary ASCII single-quote/apostrophe.
>> Not quite; $'$ has some superscripting magic associated with it.  Try
>> $\prime{}'$ and you’ll see the difference.  (Without the ‘{}’, you’ll
>> get a weird primed prime.)
>
> That is TeX's  \mathcode"8000  trick, which allows ordinary
> letters to become macros when in math-mode.
<snip>
> This makes it very convenient to do  f'' and f'''  etc.
> But other complicated superscripting should not be done this way.

I’d read about that trick.  The problem is that it want to treat $x'$
like $x^\prime$ using the large CM Math prime character. The Unicode
prime character is already at the correct size and position.  Try
$\prime{}'$ and you’ll see that the second one is shifted up by some
amount.  (With $\prime'$ it’s even worse.)


I suppose the fix for this would be to redefine the \mathcode"8000 macro
for ['] so that it directly evaluates to [′].  Or just to avoid the $x'$
form and directly use $x\prime$ or $x′$.

—Joel Salomon


More information about the XeTeX mailing list