[XeTeX] linux libertine and number

Ulrike Fischer news3 at nililand.de
Wed Dec 29 10:40:58 CET 2010


Am Tue, 28 Dec 2010 11:06:07 +0100 schrieb François Patte:


> I would like to know why the numbers are different if typed with or
> without the $ sign:

Next times make a complete example that shows the problem. 
 
> Using \setmainfont{Linux Libertine O} 7 is smaller than $7$
> 
> Is it possible to correct this? I want the same size (ie. $7$)
> 
> Of course I can always write $7$, but is there another way.

Math use mostly the standard cm-fonts. It is rather easy to change
the font of the numbers in math to libertine:


\documentclass {minimal}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\makeatletter

\AtBeginDocument{%
  \DeclareSymbolFont{numbers}{\zf at enc}{LinuxLibertineO(0)}{m}{n}
  \SetSymbolFont{numbers}{bold}{\zf at enc}{LinuxLibertineO(0)}{bx}{n}
  \DeclareMathSymbol{0}\mathalpha{numbers}{"30}
  \DeclareMathSymbol{1}\mathalpha{numbers}{"31}
  \DeclareMathSymbol{2}\mathalpha{numbers}{"32}
  \DeclareMathSymbol{3}\mathalpha{numbers}{"33}
  \DeclareMathSymbol{4}\mathalpha{numbers}{"34}
  \DeclareMathSymbol{5}\mathalpha{numbers}{"35}
  \DeclareMathSymbol{6}\mathalpha{numbers}{"36}
  \DeclareMathSymbol{7}\mathalpha{numbers}{"37}
  \DeclareMathSymbol{8}\mathalpha{numbers}{"38}
  \DeclareMathSymbol{9}\mathalpha{numbers}{"39}}

\makeatother
\begin {document}
Multiply 5 by 7: $7\times 5 = 35$

\mathversion{bold}
\bfseries

Multiply 5 by 7: $7\times 5 = 35$

\end {document}

-- 
Ulrike Fischer 



More information about the XeTeX mailing list