Well libertineotf declares which font to use for bold:
\setmainfont[Extension=.otf,
BoldFont=LinLibertine_RB,
....
And this can be a different font to the one found if you use only \setmainfont
.
You can add \XeTeXtracingfonts= 1
to your document to get some more informations in the log-file. And you can compile with xelatex --output-driver="xdvipdfxm -vv"
to see on the terminal which fonts are included.
The Linux Libertine fonts recently switched from libertine-legacy
to libertine-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
and lining
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-30 libertine
has support for osf
and nf
again.
Libertine font
The packages and font-names have changed, now you can use one of the following:
\fontfamily{LinuxLibertineO-OsF}\selectfont
\fontfamily{LinuxLibertineO-LF}\selectfont
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:
\fontseries{m} % Choose from m (medium), b (bold) and sb (semibold)
\fontshape{i} % Choose from n (normal), it (italic) and sc (small-caps)
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:
\IfFileExists{libertine-type1.sty}{ % Check for libertine-type1 package
\newcommand\libertine{LinuxLibertineO-OsF}
}{
\newcommand\libertine{fxlj}
}
And use the following in your document:
\fontfamily{\libertine}\selectfont
If you want to add options to the libertine
package, you can do this in the same way:
\IfFileExists{libertine-type1.sty}{ % Check for libertine-type1 package
\usepackage[oldstyle]{libertine}
}{
\usepackage[osf]{libertine}
}
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:
\documentclass{article}
\usepackage{lipsum} % For dummy text
\IfFileExists{libertine-type1.sty}{ % Check for libertine-type1 package
\newcommand\libertine{LinuxLibertineO-OsF}
\usepackage[oldstyle]{libertine}
}{
\newcommand\libertine{fxlj}
\usepackage[osf]{libertine}
\usepackage[T1]{fontenc}
}
\begin{document}
\section{\fontfamily{\libertine}\fontseries{b}\fontshape{sc}\selectfont Lorem ipsum dolor sit amet}
\lipsum[2]
\end{document}
With MacTeX 2012:
With TeX Live 2009:
It's not exactly the same, but acceptable.
Best Answer
The Open Type Version of Libertine has also a typewriter version. However, for
pdflatex
you can use the Bera Mono:If you want Bera Mono for LuaTeX or XeTeX then use
The TrueType font is available from http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/ A survey of monotype fonts is here: http://www.codeproject.com/Articles/30040/Font-Survey-42-of-the-Best-Monospaced-Programming