[XeTeX] fontspec, fractions, and parens

Ross Moore ross at ics.mq.edu.au
Sun Nov 18 23:32:05 CET 2007


Hello Scott,

On 19/11/2007, at 8:18 AM, Scott Murman wrote:

>>> yes, it appears that all my OT fonts have some undesirable side
> effects when choosing Fraction=On with fontspec.  i would really like
> to typeset more attractive fractions, however.  has anyone worked a
> set of macros, or is this part of xlxtra or something?  i guess it
> would be something like \onehalf, \onethird, \onequarter etc. rather
> than choosing a global mode, but this is better than nothing.

What kind of coding are you using to get fractions?

Normally in math-mode  \frac{a}{b} is the usual LaTeX way.
Here  a  and  b  can be anything, and TeX constructs the fraction.
(Get this also in displayed-math using  \tfrac{a}{b} ).


But possibly you want to access the fraction characters in a font.

  xunicode.sty  gives you macros for some of these:

\DeclareUTFcharacter[\UTFencname]{x00BC}{\textonequarter}
\DeclareUTFcharacter[\UTFencname]{x00BD}{\textonehalf}
\DeclareUTFcharacter[\UTFencname]{x00BE}{\textthreequarters}

You can easily add more, using declarations such as:

\DeclareUTFcharacter[\UTFencname]{x2153}{\textonethird}
\DeclareUTFcharacter[\UTFencname]{x2154}{\texttwothird}
\DeclareUTFcharacter[\UTFencname]{x2155}{\textonefifth}
\DeclareUTFcharacter[\UTFencname]{x2156}{\texttwofifths}
\DeclareUTFcharacter[\UTFencname]{x2157}{\textthreefifths}
\DeclareUTFcharacter[\UTFencname]{x2158}{\textfourfifths}
\DeclareUTFcharacter[\UTFencname]{x2159}{\textonesixth}
\DeclareUTFcharacter[\UTFencname]{x215A}{\textfivesixths}
\DeclareUTFcharacter[\UTFencname]{x215B}{\textoneeighth}
\DeclareUTFcharacter[\UTFencname]{x215C}{\textthreeeighths}
\DeclareUTFcharacter[\UTFencname]{x215D}{\textfiveeighths}
\DeclareUTFcharacter[\UTFencname]{x215E}{\textseveneighths}
\DeclareUTFcharacter[\UTFencname]{x215F}{\textoneover}

Does this meet your requirements?

Those are all that Unicode provides as separate characters.
For others, it is stated in the Unicode spec. that the
application is supposed to build them, as TeX does.


Maybe you are already using something like this, in which
case there could be alternative outputs from a particular font.
  fontspec.sty  offers access to these options:

861:\zf at define@font at feature{Fractions}
862:\zf at define@feature at option{Fractions}{On}{11}{1}{+frac}
863:\zf at define@feature at option{Fractions}{Off}{11}{0}{-frac}
864:\zf at define@feature at option{Fractions}{Diagonal}{11}{2}{}
865:\zf at define@feature at option{Fractions}{Alternate}{}{}{+afrc}

provided they are supported in the font, of course.


>
> -SM-

Hope this helps,

	Ross Moore

------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------




More information about the XeTeX mailing list