Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Well, the title of the question pretty much says everything. To be more precise: I'd like to know (1) what font would be visually suitable to use with Linux Libertine and/or Linux Biolinum as the main text font (I haven't decided which of the two I'll use) and (2) how to enable it (as a math font) in XeTeX.

share|improve this question
    
Perhaps consider using the XITS fonts. I also think mathspec is what you're looking for. –  user2473 Mar 7 '12 at 16:42

5 Answers 5

up vote 22 down vote accepted

A good guide on what factors to consider when mixing fonts is Thierry Bouche's Diversity in math fonts article in TUGboat, Volume 19 (1998), No. 2.

The most important aspect is to use the same font for text and math letters (as well as letter-like symbols as \partial or \infty). This has drawbacks as some letters will suffer from spacing problems, but compared to the other option (using totally different math letters), it's really a lesser evil. Of course, if this is not acceptable to you, then you should first choose the math font and then use the same font for text, but that limits your font choices dramatically.

Once you've assigned the text font to the math letters, the remaining choices you face is for the geometric symbols, the delimiters and the big operators (\sum, \int, \bigcup etc.). The main consideration is color (how bold the symbols are) and the shape of the symbols (mainly the shape of sum or integral symbols, especially if you use them often). Compared to Libertine, XITS and Asana are a bit too bold (especially true for the sum symbol), Latin Modern is a bit too light (especially +, \otimes, etc.), and Cambria has a very huge \sum symbol, huge \otimes and \oplus as well as very bold \bigcup. Thus, which font will look better will depend on what type of math you're typing, and none will be perfect.

Here's a sample to show the results of this font mixing with Libertine. Notice the spacing problems around the f in f(r_k) and \Sigma_c f(r) due to the fact that's it's a text font we're using for math. I've not set all letter-like symbols to come from Libertine (only \infty), so there's still room for improvement. (Note also the missing parenthesis in one of the formulas with Latin Modern Math.)

libertine with different math fonts

\documentclass{article}

\usepackage{amsmath}

\usepackage{fontspec}
\usepackage{unicode-math}

\setmainfont{Linux Libertine O}

\newcommand{\setlibertinemath}{%
% use Libertine for the letters
\setmathfont[range=\mathit/{latin,Latin,num,Greek,greek}]{Linux Libertine O Italic}
\setmathfont[range=\mathup/{latin,Latin,num,Greek,greek}]{Linux Libertine O}
\setmathfont[range=\mathbfup/{latin,Latin,num,Greek,greek}]{Linux Libertine O Bold}
%\setmathfont[range={"2202}]{Linux Libertine O}% "02202 = \partial % doesn't work
\setmathfont[range={"221E}]{Linux Libertine O}% "0221E = \infty
% etc. (list should be completed depending on needs)
}

\newcommand{\sample}{%
When computing the sums $\sum_{k=0}^{+\infty}{f(r_k)}$ of $f$ the integral representation of $K_0(x)$ may be used.
\[
  \eta(r)\frac{\partial f}{\partial r} + 2\Sigma_cf(r)
    = \sum_{k=0}^{+\infty}{K_0\mathopen{}\left(\frac{\lvert r - r_k \rvert}{L}\right)} 
    = \int_{0}^{\infty}{e^{-\left(z+\frac{r^2}{4L^2\pi}\right)} \frac{dz}{2z}}.
\]
We then use
\[
  \bigcup_{\lambda \in \Lambda}{U_\lambda} \cap  \bigsqcup_{\delta > 0}{G_\delta} = \bigcap_{i \in I}{\mathbf{A}_i}
  \quad \text{so that} \quad 
  u \otimes w \oplus v = 0.
\]
}

\pagestyle{empty}

\begin{document}

\section{Libertine + Latin Modern}
\setmathfont{Latin Modern Math}\setlibertinemath
\sample

\section{Libertine + Cambria}
\setmathfont{Cambria Math}\setlibertinemath
\sample

\section{Libertine + XITS}
\setmathfont{XITS Math}\setlibertinemath
\sample

\section{Libertine + Asana}
\setmathfont{Asana Math}\setlibertinemath
\sample

\end{document}
share|improve this answer

In the MWE below, a pangram is first in text italics (with Linux Libertine) and then in four different math alphabets -- Asana Math, Cambria Math (not entirely free, but quite cheap), XITS Math, and Latin Modern Math. The exercise is repeated with Linux Biolinum and the same four math alphabets, this time in sans-serif mode.

I'd say that the overall closest, though by no means perfect, fit is between Linux Libertine and Asana Math. Should you, however, wish to give considerable weight to the shape of the letters f, p, and q, XITS Math may be your best choice. Or, should you care much about compatibility of the shapes of the letter w (but not care much about the letters f and g), Cambria Math may be best for you. In any case, Latin Modern is not visually compatible with Linux Libertine.

% !TEX program = xelatex
\documentclass[letterpaper]{article}
\usepackage[no-math]{fontspec}
   \setmainfont{Linux Libertine O}
   \setsansfont{Linux Biolinum O}
\usepackage{unicode-math}
   \setmathfont[version=asana]{Asana Math}
   \setmathfont[version=cambria]{Cambria Math}
   \setmathfont[version=xits]{XITS Math}
   \setmathfont[version=lm]{Latin Modern Math}
\newcommand{\qbf}{The\ quick\ brown\ fox\ jumps\ over\ the\ lazy\ dog.}

\begin{document} 
\noindent
\emph{\qbf} --- Linux Libertine O, italics\newline
\mathversion{asana} $\qbf$ --- Asana Math\newline
\mathversion{cambria} $\qbf$ --- Cambria Math\newline
\mathversion{xits} $\qbf$ --- XITS Math\newline
\mathversion{lm} $\qbf$ --- Latin Modern Math

\bigskip\noindent
\textsf{\qbf} --- \textsf{Linux Biolinum O}\newline
\mathversion{asana} $\mathsf{\qbf}$ --- Asana Math-sf\newline
\mathversion{cambria} $\mathsf{\qbf}$ --- Cambria Math-sf\newline
\mathversion{xits} $\mathsf{\qbf}$ --- XITS Math-sf\newline
\mathversion{lm} $\mathsf{\qbf}$ --- Latin Modern Math-sf
\end{document}

enter image description here

Incidentally, the weird "tz" character in the first line (text italics, Linux Libertine) seems to be a product of an unfortunate interaction between Linux Libertine and XeLaTeX. This problem does not occur if one uses either a font other than Linux Libertine or if the MWE is run under LuaLaTeX.

Addendum To learn more about the various math symbols that the various math fonts provide, please refer to Will Robertson's write-up, Every symbol defined by unicode-math. You'll find out quickly that just about all Unicode math fonts provide all of the "standard" math symbols. However, the math font packages tend to differ importantly in the sets of specialized symbols, e.g., arrows, that they provide. Obviously, the font with the most math symbols (AFAICT, XITS Math at present) need not be the one that's best for you, simply because you may have no need for most of the symbols that the most feature-laden package provides.

Finally, then, suppose that you end up deciding to use the XITS Math font because it comes with all the special symbols you need (and the other math font packages do not). In that case, you should probably be willing to use the XITS text font, rather than Linux Libertine O, because XITS harmonizes very well (by design!) with the XITS Math font.

share|improve this answer
1  
Well, thanks, but this is not exactly what I was asking about: what about all these funny symbols used in maths: relations, operators, quantifiers, ...? –  mbork Mar 7 '12 at 23:14
    
@mbork: I've add a paragraph with information on what symbols are available in which package. –  Mico Mar 8 '12 at 12:00

A late answer (and a shameless plug), but I have been working on math companion to Linux Libertine fonts, which got more attention recently (thanks to support from TUG) and it is starting to take shape.

The character coverage is still a bit limited and there may be bugs in the existing ones, but testing and bug reports are appreciated.

I’m currently forking the whole Linux Libertine and Linux Biolinum family (and changed the name to avoid confusion and follow the reserved name clause in the license) as I need a way to quickly fix bugs I see in the text fonts (there is quite a few of them), but the idea is to merge this back with the original fonts once the dust settles.

Here is a sample (the full document is here):

Sample page showing text and math

share|improve this answer
    
Wow. Just wow. Thanks for that. (In fact, when I started reading this answer, I got excited, but not too much - I told myself "let's see first who's doing this". Now that I've scrolled to see your name I'm all excited again. –  mbork Mar 23 at 9:47
    
@mbork: I hope you find it useful :) –  Khaled Hosny Mar 24 at 6:43
    
Will the math font be usuable for pdftex? –  Keks Dose Mar 24 at 8:15
    
@KeksDose: I have no plans for providing support for 8-bit TeX engines myself, but I’m hoping that one else (e.g. the people who maintain the libertine or newtx) will do, and I’ll to help as much as possible. –  Khaled Hosny Mar 24 at 9:33

you should wait until the Lucida Math OpenType font will be published by TUG. I suppose it will be at least at the end of this year.

share|improve this answer
4  
Should be much earlier than that :) it is basically done and just awaiting a bit more of testing. –  Khaled Hosny Mar 8 '12 at 13:36
    
Well, thanks - but bad news is that I need some font for tomorrow...;) OTOH: Khaled: maybe you want one more tester?;) –  mbork Mar 8 '12 at 15:03
    
And one more question: will it fit (visually) Libertine? –  mbork Mar 8 '12 at 15:05
2  
Yes, it will ... more or less –  Herbert Mar 8 '12 at 16:16
2  
Lucida OpenType fonts have been released today. They are available at very reasonable prices from the TUG store: tug.org/store/lucida –  Ulrik Vieth Mar 16 '12 at 19:47

You can consider newtxmath with the libertine option. The math fonts used are not OpenType, so no unicode-math, but the result is pretty good. The order of packages is important.

\documentclass{article}

\usepackage{amsmath}

\usepackage[libertine]{newtxmath}
\usepackage[no-math]{fontspec}
\usepackage{mleftright}

\setmainfont{Linux Libertine O}

\pagestyle{empty}

\begin{document}

When computing the sums $\sum_{k=0}^{+\infty}{f(r_k)}$ of $f$ the integral
representation of $K_0(x)$ may be used.

\[
  \eta(r)\frac{\partial f}{\partial r} + 2\Sigma_cf(r)
    = \sum_{k=0}^{+\infty}{K_0 \mleft(\frac{\lvert r - r_k \rvert}{L}\mright)} 
    = \int_{0}^{\infty}{e^{-\mleft(z+\frac{r^2}{4L^2\pi}\mright)} \frac{dz}{2z}}.
\]
We then use
\[
  \bigcup_{\lambda \in \Lambda}{U_\lambda} \cap  
    \bigsqcup_{\delta > 0}{G_\delta} = \bigcap_{i \in I}{\mathbf{A}_i}
  \quad \text{so that} \quad 
  u \otimes w \oplus v = 0.
\]

\end{document}

enter image description here

share|improve this answer
    
The numerals in the image look like Computer Modern. (As does the non-summation capital sigma early in the first equation.) –  hftf Mar 21 at 20:58
    
@hftf Eagle eye! I found a fix, thanks. –  egreg Mar 21 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.