[XeTeX] linux libertine and number

Ulrike Fischer news3 at nililand.de
Wed Dec 29 10:53:05 CET 2010


Am Tue, 28 Dec 2010 19:08:57 +0000 schrieb Philip Taylor (Webmaster,
Ret'd):


> Bonjour, François : is this perhaps the sort of
> thing you had in mind ?
> 
> \documentclass {minimal}
> \usepackage {fontspec}
> \setmainfont {Linux Libertine O}
> \begin {document}
> Multiply 5 by 7: $7\times 5 = 35$
> 
> \catcode `\5 = \active
> \catcode `\7 = \active
> \def 5{\ifmmode \string 5 \else $5$\fi}
> \def 7{\ifmmode \string 7 \else $7$\fi}
> Multiply 5 by 7: $7\times 5 = 35$
> 
> \end {document}
> 
> Obviously you can \catcode and \def all digits
> from zero to nine in a simple loop to cope with
> the general case.

It is a very bad idea to make numbers active and to define them in
this way. As an example try to uncomment one of the last lines:

\documentclass {article}
\usepackage {fontspec}
\setmainfont {Linux Libertine O}
\usepackage{tikz}
\begin {document}
Multiply 5 by 7: $7\times 5 = 35$

\catcode `\5 = \active
\catcode `\7 = \active
\def 5{\ifmmode \string 5 \else $5$\fi}
\def 7{\ifmmode \string 7 \else $7$\fi}
Multiply 5 by 7: $7\times 5 = 35$

%\tikz \draw (0,0)--(1,5);
%\section{5 and 7}
\end {document}

-- 
Ulrike Fischer 



More information about the XeTeX mailing list