# Linux Libertine Biolinum xelatex and lualatex

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.
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.

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.

-
Why didn't you simplx use \usepackage{libertineotf}? It does all the font setting. –  Herbert Mar 24 '12 at 13:19
@Herbert: Thank you for the suggestion. I had tried only \usepackage{libertine} which did not work as expected. With \usepackage{libertineotf} though, I get slanted small caps, not the upright version. But the file does compile with both xelatex and lualatex. –  chandra Mar 25 '12 at 3:09

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:

-
Thank you. Your solution works with both xelatex and lualatex and gives me the desired output. The libertineotf package seems to add slanted small caps instead of upright small caps as noted above. With your solution, I get an output exactly matching yours after removal of the superfluous text in brackets. I am using the Libertine font package version 5.1.3 from the home page of the font and there is no problem with Scale=MatchLowercase as far as I can tell. –  chandra Mar 25 '12 at 3:18
Oops! I spoke too soon. I do need to deselect Scale=MatchLowercase or Biolinum explodes in size with the \fontsize command. Thank you for solving a problem in anticipation, even before I experienced it. –  chandra Mar 25 '12 at 8:14
\documentclass[a4paper]{article}
\usepackage{fontspec}
\usepackage[libertine={Ligatures=TeX,RawFeature=+onum},
biolinum={Ligatures=TeX,RawFeature=+onum}]{libertineotf}

\begin{document}
\sffamily
\noindent Linux Biolinum sans serif text followed by \Lsmcp{Sans serif Small Caps text.} \Lsmcp{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.}
0123456

\medskip\rmfamily
\noindent Linux Libertine serif text followed by \Lsmcp{Sans serif Small Caps text.} \Lsmcp{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.}
0123456
\end{document}

-
Thank you for showing how to do it with libertineotf. This solution works fine too, both with xelatex and lualatex`. It is a shame that only one answer is allowed per question. –  chandra Mar 25 '12 at 14:26