Specifying proportional numbers when using Libertine with pdfLaTeX

Here’s an answer for the current libertine version of 2014/11/25, since lockstep’s answer doesn’t work anymore with this current version (probably due to the changes in maintainer and conception since 2011).


Generally, Linux Libertine’s digits are either proportional (different widths) or tabular (same widths), and either oldstyle (different heights) or lining (same heights):

By default, i.e. if you don’t change anything, libertine uses tabular lining figures.

You can specify the style of numbers in three different ways, which have different ranges.

Package options – global effect

  • oldstyle (or osf) for old-style figures
  • lining (or nf or lf) for lining figures
  • proportional (or p) for varying-width figures
  • tabular (or t) for fixed-width figures

These apply to the entire document. Of course, it only makes sense to specify either oldstyle or lining, and either proportional or tabular. Example:

\usepackage[oldstyle, proportional]{libertine}

\fontfamily{…} – local effect

This way is not described in the libertine documentation.

  • proportional oldstyle figures: \fontfamily{LinuxLibertineT-OsF}\selectfont 123
  • proportional lining figures: \fontfamily{LinuxLibertineT-LF}\selectfont 123
  • tabular oldstyle figures: \fontfamily{LinuxLibertineT-TOsF}\selectfont 123
  • tabular lining figures: \fontfamily{LinuxLibertineT-TLF}\selectfont 123

These commands are placed in the document body, not in the preamble, and they change the font starting at the point where they’re placed. For more details on how to use these commands, have a look at the LaTeX answer to How do I use a particular font for a small section of text in my document?. Example:

123 tabular lining figures (default) up to here
\fontfamily{LinuxLibertineT-LF}\selectfont
123 proportional lining figures from now on

Macro – small, selective effect

  • \oldstylenums{123}
  • \liningnums{123}
  • \proportionalnums{123}
  • \tabularnums{123}

These macros only change the style of the numbers in the argument. Example:

123 tabular lining figures (default), but then \oldstylenums{123
(still tabular) oldstyle figures} and back to 123 tabular lining
figures

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}