I recently heard that there is a package called unicode-math that makes it possible to use an ordinary TTF/OTF font for mathematic typesetting. To what degree is that possible with Linux Libertine? I love this font, only the lack of math-support is a bit annoying, although euler is a good match IMHO.

7 Answers 7


To provide a more current answer to this, there is now Libertinus, a fork of Linux Libertine with bug fixes and pretty nice math support (check out this example document).



\setmainfont{Libertinus Serif}
\setsansfont{Libertinus Sans}
\setmathfont{Libertinus Math}

The formula \(E=mc^2\) is arguably the most famous formula in physics.

In mathematics, it could be \(\mathrm{e}^{\mathrm{i}\uppi}-1=0\).

\(\displaystyle \sum_{k=0}^\infty \frac{1}{k^2} = \frac{\uppi^2}{6}\), and
\(\displaystyle \int\displaylimits_{-\infty}^\infty 
   \exp\left(-\frac{x^2}{2}\right) = \sqrt{2\uppi}\).

\(\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu\xi\pi\rho\sigma\tau\upupsilon\phi\chi\psi\omega \varepsilon\vartheta\varrho\varsigma\varphi\varkappa\)

\(\upalpha\upbeta\upgamma\updelta\upepsilon\upzeta\upeta\uptheta\upiota\upkappa\uplambda\upmu\upnu\upxi\uppi\uprho\upsigma\uptau\upupsilon\upphi\upchi\uppsi\upomega \upvarepsilon\upvartheta\upvarrho\upvarsigma\upvarphi\upvarkappa\)




  • The link to the example document is dead.
    – Kubo
    Sep 11, 2018 at 7:30
  • 1
    @Kubo: I fixed the link.
    – lblb
    Sep 15, 2018 at 7:48

There is a new LaTeX math package called newtx with a libertine option that matches Libertine text, using Libertine Roman italic and Greek together with symbols from the old txfonts package, remetrized so as not to be as cramped, and with optical versions of math italic and symbols. Versions prior to 0.93 were problematic, but 0.93, which should appear shortly on CTAN, seems to work well.

  • 2
    Welcome, Michael. Remember to register, as we look forward for your valuable contributions.
    – egreg
    May 22, 2012 at 22:25
  • 8
    I would go as far as to say that Linux Libertine is (sadly) more or less useless for setting LaTeX documents that includes any type of math without newtxmath (described in the documentation for newtx) loaded. The vanilla metrics are completely bonkers in math mode if one naively sets Linux Libertine as a math font, and one will have to spend hours on manual kerning to get nice results. Or: just issue \usepackage[libertine]{newtxmath} and get good results immediately. Some situations may still call for manual kerning, but several order of magnitudes fewer than without the package. Aug 30, 2014 at 12:53

It's not too hard to use it for the variables and constants (letters). For XeLaTeX, you could use the mathspec package. For regular PDFLaTeX, you could use the mathastext package, e.g.:


That will give you Computer Modern symbols with Libertine letters and numbers. See the mathastext documentation for options regarding Greek, etc. If you load another symbol font (eulervm, etc.) before loading these you'll get its symbols with libertine letters. Personally I like to load txfonts for symbols, and then load these.

I don't know to make it work if you want the few symbols it contains (which is more than most fonts, but certainly not quite enough either), you could probably use unicode-math, but you'll have to switch back to other fonts for the many symbols it lacks.

  • Is it possible to use it for, say, \sum, \int and friends? I think you call them "bigops"
    – FUZxxl
    Oct 5, 2011 at 15:11
  • As far as I know the font does not provide these characters.
    – Ingo
    Apr 6, 2012 at 16:00

Here is a modified version of Mico answer that does not use mathspec. Neo Euler is set as base math font (can be replaced by any OpenType math font), but math roman and italic are taken from Linux Libertine.

\setmainfont[Ligatures=TeX]{Linux Libertine O}
\setmathfont[Scale=MatchLowercase]{Neo Euler} 
\setmathfont[range=\mathup]{Linux Libertine O}
\setmathfont[range=\mathit]{Linux Libertine O Italic}
\setmathfont[range=\mathbfup]{Linux Libertine O Bold}
\setmathfont[range=\mathbfit]{Linux Libertine O Bold Italic}

The formula $E=mc^2$ is arguably the most famous formula in physics.

In mathematics, it could be $\mathrm{e}^{\mathrm{i}\pi}-1=0$.

$\displaystyle \sum_{k=0}^\infty \frac{1}{k^2} = \frac{\pi^2}{6}$, and
$\displaystyle \int_{-\infty}^\infty 
   \exp\left(-\frac{x^2}{2}\right) = \sqrt{2\pi}$.


Notice the bad placing of some superscripts since Libertine is not a proper math font.


The package unicode-math requires XeLaTeX or LuaLaTeX and a font that has special mathematical tables and, currently, there's no such font in the Linux Libertine family.

With XeLaTeX you can try

  [Numbers={Lining,Proportional}]{Linux Libertine O}

but as Linux Libertine O Italic has not the right parameters for letters as math symbols, some adjustments are needed in certain situations, see the manual of mathspec.


Note: I changed the answer below after learning that the OP prefers "Neo Euler" to "XITS Math".

As others have noted, there is as of now no OpenType math version of the Linux Libertine fonts. You've indicated that you'd might want to use the Neo Euler fonts. Font purists will no doubt be able to point out any numbers of differences between the two fonts; let me just say up front that I will fully agree with all of their points, but we're consciously making a compromise here.

A consideration is how to scale the math font; usually, a good starting point is to set "Scale=MatchLowercase". Second, Neo Euler only has "upright" rather than slanted font shapes for letters and numerals; in consequence, it's probably a good idea to use Libertine's italics (text) font for upper- and lowercase letters as well as for numerals, even though the glyphs' sidebearings won't be correct in many cases. The code below, which uses the mathspec package, illustrates the results of scaling Neo Euler to have the same x-height as Linux Libertine.

% !TeX program = xelatex
\setmainfont[Ligatures=TeX]{Linux Libertine O}
\setmathfont[Scale=MatchLowercase]{Neo Euler}
\setmathfont(Digits,Latin,Greek){Linux Libertine O} % override

The formula $E=mc^2$ is arguably the most famous formula in physics. 

In mathematics, it could be $\mathrm{e}^{\mathrm{i}\pi}-1=0$.    

$\displaystyle \sum_{k=0}^\infty \frac{1}{k^2} = \frac{\pi^2}{6}$, and
$\displaystyle \int_{-\infty}^\infty 
   \exp\left(-\frac{x^2}{2}\right) = \sqrt{2\pi}$.

enter image description here

Observe the near-collisions between letters and superscript numerals, which are a consequence of the fact that the letters and digits come from a text rather than from a math font.

Personally, I think it's preferable to use a dedicated math font such as XITS Math together with Linux Libertine. Obviously, this will also entail making some compromises, but at least the spacing around math glyphs won't be an issue. One would load the XITS Math package as follows (note the use of the fontspec and \unicode-math packages instead of the mathspec package):

\setmainfont[Ligatures=TeX]{Linux Libertine O}
\setmathfont[Scale=MatchLowercase]{XITS Math}

The resulting output from the preceding MWE would then look like this: enter image description here

Happy TeXing!

  • 1
    Thank you for the help, but it's just - well - I hate this font. It looks too sharp and is no match for the rather round and organic libertine... btw, is there also a way to rescale euler to match libertine in height?
    – FUZxxl
    Oct 5, 2011 at 16:10
  • Yeah, Times New Roman (the model for XITS) is not to everyone's taste! I've revised my answer to play off Libertine Text and Neo Euler math. As you'll see, you still need to make a decision regarding scaling of the math font.
    – Mico
    Oct 5, 2011 at 16:49
  • 1
    You need math-style=upright with Neo Euler (since it has no math italics), else you will get LM Math italic (as in the sample you posted above). But since Euler alphabet is so much different from Libertine (XITS is much more closer), you better use Libertine text italic in math as well (though it has side effects) and keep Euler for math symbols. Oct 5, 2011 at 17:08
  • @KhaledHosny -- thanks! I've made the change in the code and the displayed image. I fully agree with you, incidentally, that XITS Math is a much better match for Linux Libertine than Neo Euler is.
    – Mico
    Oct 5, 2011 at 17:31
  • @Mico hm... The image is still not quite correct...
    – FUZxxl
    Oct 5, 2011 at 17:57

If you also thought that MnSymbol fits best to Libertine here is a (quite well) working hack:

\protected\def\mathbb#1{\text{\usefont{U}{msb}{m}{n}#1}} %gives us blackboard back -> http://tex.stackexchange.com/questions/214570/try-to-use-ams-blackboard-bold-font-together-with-texgyrepagella
0123456789 äüöÄÜÖß Office The $\sum_{i=1}^\infty\alpha\xi\geq\oplus\alpha\sqrt[n]{n}$
$$\left(\int_{i=0}^\infty\times \sum_{i=0}^\infty\right)\idotsint$$

The output is: Linux Libertine Math Output

Now compared to MinionPro: MinionPro Output as a comparison

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .