[XeTeX] Single glyphs from a font
Joel C. Salomon
joelcsalomon at gmail.com
Tue Jun 9 04:11:26 CEST 2009
Ross Moore wrote:
> On 09/06/2009, at 6:08 AM, Joel C. Salomon wrote:
>>> I’m trying to create this effect:
>>> a² + b² = c² (1)
>>> x² + y² = z² (1′)
>>
>> I think I figured it out. In my preamble I have:
>> \newfontface\cambriamath{Cambria Math}
>> \newcommand{\textprime}{\cambriamath ′}
>> Then the equation looks like:
>> \begin{equation} \label{abc}
>> a^2 + b^2 = c^2
>> \end{equation}
>> \begin{equation*} \label{abc:prime} \tag{\ref*{abc}\textprime}
>> x^2 + y^2 = z^2
>> \end{equation*}
>> This works, but need I be wary of font-change commands in \tag{}s?
>
> Yes, you probably should be.
<snip>
> Now to get the math symbol using Cambria, do similarly
> to my previous posting about \ldots and \cdots, etc.
> (on the "Unicode maths for TeX" email list)
> viz.
>
> \makeatletter
> \let\UnicodeMathSymbol\um at mathsymbol@noparse
> \UnicodeMathSymbol{"02026}{\mathellipsis}{\mathrel}{ellipsis}%
> \UnicodeMathSymbol{"02032}{\prime}{\mathord}{prime}%
OK, we’re filling what’s missing from unicode-math.tex. I tried that,
but I missed the
\let\UnicodeMathSymbol\um at mathsymbol@noparse
that makes the command work!
> \let\prime ′
> \let\mathellipsis …
Noting for the record that defining \mathellipsis causes amsmath’s
\dotsc &c. to use that symbol. (You know that, but I only found that
out by searching my MiKTeX installation tree.)
> \let\@ldots …
> \let\@cdots ⋯
> \makeatother
What are these definitions for? These commands are about to be
unaccessible after \makeatother. Is there some package that’s expecting
these names?
(B.T.W., unicode-math.tex already declares ‘⋯’ to be a \mathrel, so I
omitted that line.)
So basically, the reason \tag{\ref*{abc}$′$} didn’t work before was that
the TeX didn’t know what math category the prime character fell into, so
it got ignored?
> 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.)
(B.T.W., re. the ‘*’: I’m using hyperref; Ignore it.)
Thanks for the help,
—Joel Salomon
More information about the XeTeX
mailing list