# 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, 2018 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, 2018 at 0:31
• Hmm, I think because I know the raw feature names, RawFeature makes more sense to me.
– Roxy
Dec 6, 2018 at 4:17
• @Mico It works well for me for the serif/italic font, but regarding the comment for the sans-serif font: I just tried it (switched to Biolinum or Libertinus Sans with \setsansfont and \sffamily), and only the ff, ft, tt, ct and st ligatures show up. fi, fj, fl, and Th do not. Do you know if this is a (lacking) feature of the fonts or am I doing something wrong here? May 4, 2020 at 19:11
• @Faekynn - I don't think you're doing anything wrong: Both Linux Biolinum O and Libertinus Sans feature far fewer ligatures than their Serif counterparts do. I'm not an expert in font design; that said, it is my impression that sans-serif fonts generally make do with fewer ligatures. This may be because of their lack of serifs.
– Mico
May 4, 2020 at 20:39

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.