[XeTeX] Beginner's question - font for numbers

Gareth Hughes garzohugo at gmail.com
Fri Oct 9 13:03:41 CEST 2009


Peter Dyballa wrote:
> 
> Am 08.10.2009 um 18:30 schrieb George:
> 
>> Hello - is there a way to use a different font just for numbers, in a
>> non-math text?
> 
> 
> Yes: \newfontfamily\digitsfont{Times 10 Roman Small Caps and Oldstyle
> Figures}. Then:
> 
> This short text has {\digitsfont 7} words and {\digitsfont 2} numbers.
> 
> You could also create a command
> \DeclareRobustCommand{\old}[1]{{\digitsfont #1}} and use:
> 
> This short text has \old{7} words and \old{2} numbers.
> 
> 
> This would be the way when the font you want to use does not have lining
> numbers for the digits but oldstyle figures, like Venturis ADF Cd Style
> in TeX Live.
> 

Although, it would be far easier to define:

\setmainfont[SmallCapsFont={Times 10 Roman Small Caps and Oldstyle
Figures}]{Times Ten Greek}

and then to use the form

\textsc{7}

for every instance of a number, without having to declare new commands.
I'm sure there's probably a deeper workaround involving redefining
numbers as active, or editing the fonts directly. It just really depends
on how many numbers you have and how TeX/font dirty you want to get!

Gareth.


More information about the XeTeX mailing list