# How to turn on font features with Libertine and LuaLaTeX?

I'd like to get the Libertine fonts with the font features hlig, liga and onum, and also load the relevant mono font and Biolinum for the sans font.

It seems I can simply use \usepackage{libertine} to get the font with LuaTeX according to the Libertine documentation, but having read that plus the fontspec documentation, I'm not able to figure out how to actually turn on these features. Something to do with Ligatures=Common, Ligatures=Historic, etc. but where do I put these?

• Did you try (a) loading the fontspec package and (b) issuing the instruction \setmainfont{Linux Libertine O}[Ligatures={Common,Rare,Historic}, Numbers=OldStyle] – Mico Dec 6 '18 at 0:19

Something like this? (to be compiled under LuaLaTeX or XeLaTeX)

Speaking for myself, I find Ligatures={Common,Rare,Historic}, Numbers=OldStyle easier to read than RawFeature=+liga;+dlig;+hlig;+onum.

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}%
[Ligatures={Common,Rare,Historic}, Numbers=OldStyle]
\begin{document}
0123456789

ff fi fj fl ft ffi ffl fft, tt, ct st

\itshape
ff fi fj fl ft ffi ffl fft, tt, ct st
\end{document}

• To add the associated sans-serif font, you could run \setsansfont{Linux Biolinum O}[Ligatures={Common,Rare,Historic}, Numbers=OldStyle] after \setmainfont. Not sure which mono font you consider to be the "relevant" one. – Mico Dec 6 '18 at 0:31
• Hmm, I think because I know the raw feature names, RawFeature makes more sense to me. – Roxy Dec 6 '18 at 4:17

From page 3 of the libertine package manual:

The option defaultfeatures=... allows the user to add default OpenType features.

You can therefore do this in XeLaTeX or LuaLaTeX:

\documentclass[varwidth, preview]{standalone}
\usepackage[defaultfeatures={Ligatures={Common, Historic, TeX}}
]{libertine}

\begin{document}
Test
\end{document}


You can also use another package, such as libertine-otf, with a Ligatures= package option. Or bypass the package entirely and use fontspec.