So in the last couple of weeks I've had some issues with the Linux Libertine font and
package, both don't seem to work anymore on a completely up-to-date version of MacTeX (which is equivalent to TeX Live 2012). The issues don't appear on a Ubuntu 12.04
box which is running TeX Live 2009; I work on both computers regularly so
it would be nice if any solution would work on both systems.
I'm compiling my files with pdflatex
.
As I have two problems (one with the package and one with the font itself) I'll
split this question in two parts.
Libertine Package
I've always been using the libertine
package like this:
\documentclass{article}
\usepackage[osf]{libertine}
\usepackage[T1]{fontenc}
\begin{document}
The quick brown fox jumps over the sleazy dog, 0123456789.
\end{document}
This however gives me the following warning and error:
LaTeX Warning: You have requested package `libertine-type1',
but the package provides `LinuxLibertineO'.
! LaTeX Error: Unknown option `osf' for package `libertine-type1'.
When I ignore it, the output seems to be fine:
Libertine font
I've also been using this font directly in other documents, like this (cf. How do I use a particular font for a small section of text in my document?):
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\fontfamily{fxlj}\selectfont
The quick brown fox jumps over the sleazy dog, 0123456789.
\end{document}
This gives the following warning:
LaTeX Font Warning: Font shape `OT1/fxlj/m/n' undefined
(Font) using `OT1/cmr/m/n' instead on input line 3.
And shows the following output:
Best Answer
The Linux Libertine fonts recently switched from
libertine-legacy
tolibertine-type1
in TeX Live. This resulted in many documents not working any more, especially with old-style-figures.Libertine Package
Old-style-figures are default in the latest version, so just use:
\usepackage{libertine}
or\usepackage[oldstyle]{libertine}
.The fact that the osf option doesn't work seems to be a bug, as they list it in the documentation (nf is also broken).If you don't want old-style-figures, use:
\usepackage[lining]{libertine}
The options
oldstyle
andlining
won't work with the old package- so it's kind of a shame that osf and nf are broken.As of (at least) 2012-10-30libertine
has support forosf
andnf
again.Libertine font
The packages and font-names have changed, now you can use one of the following:
The first is for old-style figures. Remember: you should always import the package the font comes with, even if you only use it in titles. If you don't, you might have to select the font weight and shape manually (after the font-family) with:
There are many more shapes, the rest is listed in the documentation.
Compatibility
If you want to make your document work on both TeX Live 2012 and 2009, I recommend defining a command for it:
And use the following in your document:
If you want to add options to the
libertine
package, you can do this in the same way:This will work with both the old and the new package. It is also nice to know that the new
libertine
package also does the\usepackage[T1]{fontenc}
for you.Example
In the following example I've tried to apply as much as possible:
With MacTeX 2012:
With TeX Live 2009:
It's not exactly the same, but acceptable.