[XeTeX] Setting alphanumerical math font

Will Robertson wspr81 at gmail.com
Mon Feb 18 01:32:51 CET 2008


On 17/02/2008, at 10:13 AM, Peter Dyballa wrote:

> Am 16.02.2008 um 17:09 schrieb Tammo Jan Dijkema:
>
>> I would like to use some (OpenType) font to set just
>> the alphanumerical characters A-Z, a-z, 0-9 in math
>> mode.
>
> Have you seen \setmathrm, \setboldmathrm, \setmathsf, \setmathtt in
> fontspec documentation?

These only set the \mathrm, bold \mathrm, \mathsf, and \mathtt fonts,  
respectively. \mathit is set implicitly by \setmathrm, too.

Unfortunately, Tammo, I haven't yet written any support for what you'd  
like to do. Here's a template that you can build on the fake the maths  
support you need. Look in fntguide.pdf for explanations of  
\DeclareSymbolFont and \DeclareMathSymbol; note that you can only  
access glyphs in the first 256 slots of the font; this means no Greek,  
for example.

\documentclass[12pt]{article}
\makeatletter
\usepackage[no-math]{fontspec}
\setmainfont{Georgia}
\DeclareSymbolFont{MRM}{EU1}{\zf at family}{m}{n}
\DeclareSymbolFont{MIT}{EU1}{\zf at family}{m}{it}
\DeclareMathSymbol{A}{\mathalpha}{MIT}{`\A}
\DeclareMathSymbol{B}{\mathalpha}{MIT}{`\B}
\DeclareMathSymbol{C}{\mathalpha}{MIT}{`\C}
\DeclareMathSymbol{1}{\mathord}{MRM}{`\1}
\DeclareMathSymbol{+}{\mathbin}{MRM}{`\+}
\DeclareMathSymbol{=}{\mathrel}{MRM}{`\=}
\begin{document}
\noindent text: \textit{A+B}+1=\textit{C}\\
math: $A+B+1=C$
\end{document}

Hope this helps,
Will
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2415 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20080218/de77abd0/attachment.bin 


More information about the XeTeX mailing list