[Tex/LaTex] Linux Libertine Biolinum xelatex and lualatex

fontslibertineluatexsmall-capsxetex

This is actually two questions rolled into one. Consider the example file below:

\documentclass[a4paper]{article}
\usepackage{fontspec}
%
\defaultfontfeatures{Ligatures=TeX,Numbers=OldStyle,Scale=MatchLowercase}
\setmainfont[SmallCapsFont={Linux Libertine Capitals O}]{Linux Libertine O}
\setsansfont[SmallCapsFont={Linux Biolinum Capitals O}]{Linux Biolinum O}
%
\begin{document}
\begin{sffamily}
\noindent Linux Biolinum sans serif text followed by {\scshape Sans serif Small Caps text.} {\scshape Small Caps disappear when diacritics are used like a macron above a in anāchron: note the small letter for the ā instead of a Small Caps version.}
\end{sffamily}

\medskip

\noindent Linux Libertine serif text followed by {\scshape Sans serif Small Caps text.} {\scshape Small Caps disappear when diacritics are used like a macron above a in anāchron: note the small letter for the ā instead of a Small Caps version.}
\end{document}

It compiles with xelatex but not with lualatex. My fontspec package gives
\ProvidesPackage{fontspec}
[2011/09/18 v2.2a Advanced font selection for XeLaTeX/LuaLaTeX]

The installation is on a 64-bit daily-updated TeX Live 2011 installation.

With lualatex I get this error:

! Improper `at' size (0.0pt), replaced by 10pt.
<to be read again> 
                   relax 
l.10 ...inum sans serif text followed by {\scshape
                                                   Sans serif Small Caps tex...

Question 1: Why is the file failing to compile with lualatex?

Question 2: There is no small caps "a" with a macron in the PDF output. I just also noticed that the tt is not in small caps. See this result

I have reported this behaviour at the Linux Libertine project page, but in the absence of a response therefrom, I want to ensure that there is no usage error on my part.

Thanks.

Best Answer

Your document doesn't compile with XeLaTeX on my system, so I can't compare LuaLaTeX and XeLaTeX.

There is a tiny problem in the code, but I am not the expert here:

\setmainfont[SmallCapsFont={Linux Libertine Capitals O}]{Linux Libertine O}

With OpenType fonts the small caps are included in the main font. So there is no reason to explicitly mention a different one. Linux Libertine at least has them built in. Then there is no font Linux Libertine Capitals O on my system and I don't think that I have removed them explicitly.

Linux Libertine does not have a small caps ā in the font as far as I can see. And thus there is no way to display it. (You could fake it though.)

The problem with the small tt does not exist here, so I can't comment on that either. But I guess the correct answer is what Herbert commented:

Why didn't you simply use \usepackage{libertineotf}? It does all the font setting.

\documentclass[a4paper]{article}
\usepackage{fontspec}

\defaultfontfeatures{Ligatures=TeX,Numbers=OldStyle}% ,Scale=MatchLowercase} bug in current Biolinum
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}

\begin{document}

\noindent Linux Libertine serif text followed by {\scshape Sans serif Small Caps text.} {\scshape Small Caps disappear when diacritics are used like a macron above a in anāchron: note the small letter for the ā instead of a Small Caps version.}

\medskip

\sffamily
\noindent Linux Biolinum sans serif text followed by {\scshape Sans serif Small Caps text.} {\scshape Small Caps disappear when diacritics are used like a macron above a in anāchron: note the small letter for the ā instead of a Small Caps version.}

\end{document}

gives:

libertinesmallcaps