# Libertine fancy fractions not working with LuaTeX

Here is my code.

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Fractions=On]{Linux Libertine O}
\begin{document}

1/2 3/4 5/6 7/8 9/10 11/12 31415/27182 1000/1000000

\end{document}


Compiling with TeX Live LuaLaTeX on Lubuntu gives the following output:

According to this answer, it should be possible to achieve this effect with Libertine. The line I commented out in the code is another method I tried, which produced the same incorrect output as shown.

• Might it be the case that thelibertineotf package provides additional code not found in the font itself? Note the difference between your code and the linked answer: You called the font directly, using fontspec, but the linked answer has \usepackage{libertineotf}. – user103221 Apr 4 '17 at 22:05
• More: The libertineotf package is marked as obsolete, at CTAN. But it is still available. I looked at it, and it does indeed contain some code other than just the fonts. However, you can still get fractions the hard way (not very hard) by using features such as sups and subs (or sinf) for the separate numerators and denominators. So what you need can be done, but maybe in a way different than you expected. – user103221 Apr 4 '17 at 22:21
• @RobtA Only because libertine.sty now handles the Unicode engines. And libertineotf.sty isn't only on CTAN. It is still part of the libertine package installed, for example, as part of TeX Live. Just it shouldn't be used for new documents. – cfr Apr 5 '17 at 0:18
• @cfr Good clarification. I use only LuaLeTeX, and load fonts directly rather than via packages. No problem. Maybe this is the situation faced by the OP. – user103221 Apr 5 '17 at 0:57

Note that I used XeLaTeX for compilation. The code does not work with LuaLaTeX.

I get warnings, but the output looks as it looks in the linked answer.

Although libertineotf.sty is obsolete, this is only because libertine.sty now handles both the unicode engines and (to some limited extent) the traditional ones.

\documentclass{article}
\usepackage{libertine}
\begin{document}

1/2 3/4 5/6 7/8 9/10 11/12 31415/27182 1000/1000000

\end{document}


If you don't wish to use the libertine package for some reason, you can do exactly the same with fontspec. As a bonus, I don't get the warnings mentioned above in this case.

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Fractions=On]{Linux Libertine O}
\begin{document}

• @RobtA There is no mention of frac in libertine.sty. RawFeature allows the use of features supported by the font, but with no fontspec interface. – cfr Apr 5 '17 at 1:18