# Specifying proportional numbers when using Libertine with pdfLaTeX

If I use the Libertine fonts from within XeLaTeX I can specify the use of proportional numbers/figures by including it as an option when I set the main font like so:

\setmainfont[Numbers={Lining,Proportional}]{Linux Libertine O}


However, I'm also interested in being able to using proportional numbers when using pdfLaTeX. Below is a MWE that shows one way to do this. My "solution" seems awfully ugly though. Is there a better way to accomplish this?

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{libertine}

\begin{document}
% this seems necessary to get proportional numbers in Libertine
% when using pdflatex. Comment / uncomment to see the difference
\usefont{T1}{fxlf}{m}{n}\selectfont

I would like the following numbers to be proportional so that 11,
doesn't take up as much space as 17. See what I mean?

\end{document}

-
According to p. 7 of the libertine/biolinum user manual, your method is exactly what one should do to get proportionally-spaced lining/uppercase numbers. There seems to be no ready-made option at the package's load time in order to achieve this effect. If this method seems "ugly" to you, you could always encase it in a command and execute it in the document's preamble... –  Mico Nov 17 '11 at 4:35
I was afraid that might be the case. I was hoping there was a generic way to do this in pdfLaTeX in the same way that there is in XeTeX. –  Paul M. Nov 17 '11 at 15:33
@Mico Would you turn your comment into an answer? –  egreg Dec 3 '11 at 22:34

As Mico has commented, "[t]here seems to be no ready-made option at the package's load time in order to achieve this effect." However, if you want to put your specification in the preamble, you have use \AtBeginDocument{\usefont{T1}{fxlf}{m}{n}\selectfont}. Another possibility is to redefine libertines internal commands:

\documentclass[12pt]{article}

\usepackage[T1]{fontenc}
\usepackage{libertine}

\makeatletter
\def\libertine@param{fxlf}% comment / uncomment to see the difference
\def\biolinum@param{fxbf}
\makeatother

\begin{document}

I would like the following numbers to be proportional so that 11,
doesn't take up as much space as 17. See what I mean?

\end{document}

-