[XeTeX] linux libertine and number

Tobias Schoel liesdiedatei at googlemail.com
Wed Dec 29 13:45:12 CET 2010


Hi,

> I could have used array instead of longtable but, it is not handy to
> write "normal text" within the mathematical mode and I need to mix both...

the package "array" helps. it defines the >{} and <{} column modifiers 
for tabular environments:

\documentclass{minimal}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{Linux Libertine O}
\setmathfont{Asana Math}
\usepackage{array}
\begin{document}

\begin{tabular}{l>{$}l<{$}}
5+7&5+7
\end{tabular}

\end{document}

The second column is in math mode.


> Ross has pointed the problem of spacing and shape of mathematical symbol
> (and some oher ones..): indeed \texttimes is not the same as $\times$
> for instance.

And that should be thought about. What do you want to express: Some kind 
of math, then it should be typed like math. A symbol for the grammatical 
numerals "five" and "seven"? Then it should be typed like text.

Btw: It's spacing and font which differ in math- and text-mode.
Btw2: The multiplication sign is in unicode at u00d7: ×.

>
> I was wondering if there would be some fonts feature like:
> [Numbers=OldStyle], one could imagine: [Numbers=MathNumbers]
>
> You have a lot of similar options if you use kpfonts. Unfortunately,
> these kpfonts do not work with xelatex and I need xelatex, to have
> Sanskrit texts (which I mix in my article) hyphenated... I don't know
> how to adapt the   gloss-sanskrit.ldf file for a use with babel.
>
> Thanks for all these answers.

Another solution: the package "siunitx" supplies a good number parser. 
Try the following:
\documentclass{minimal}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{Linux Libertine O}
% \setmainfont{TeX Gyre Pagella}
\setmathfont{Asana Math}
\usepackage{siunitx}
\begin{document}
5×7 : \(5\times 7\) : \num{5x7} : \sisetup{mode=text}\num{5x7}\\
\end{document}

Yet another solution: The font TeX Gyre Pagella is similar to Linux 
Libertine and works like charm with the math font Asana Math. Simply 
change the comments before the \setmainfont-commands in the above examples.

Bye

Toscho


More information about the XeTeX mailing list