10

In most fonts, arabic digits have nonproportional width, meaning that 1 and 8 have exactly the same width even if the former has a smaller natural width. This is good for typesetting tables, but in running text this distracts:

\documentclass{article}
\pagestyle{empty}


\begin{document}
  Look at this figure:
  1,123,456 cars.
  How to remove the extra space between the first two 1?
\end{document}

Result

I feel that there's slightly too much space between the first two "ones". What do the typographers think about this issue? How do I enable kerning of digits (or just usage of their natural width) in running text?

  • 3
    in metal fonts, there were two different sets of digits, one to be used in text ("natural" width), and a different one (monowidth) to be used in tables. computerized composition "simplified" this, choosing the monowidth version since much of the early computer-generated material was tables. how proportional widths might be enabled for digits depends on the flavor of tex being used, and how fonts are accessed. for "traditional" tex, using tfm files, the original font could be cloned under a new name, and new widths assigned manually via a .pl file. – barbara beeton Jul 11 '12 at 13:27
  • @barbarabeeton: Wow. So no hope for a \propdigits command or environment? – krlmlr Jul 11 '12 at 13:43
  • 1
    probably someone could construct such a command, but it would likely have to be different for every font, and i'm not aware that anyone has done it yet. (someone else may know different.) – barbara beeton Jul 11 '12 at 13:46
14

OpenType has among its many standard font features the option tnum for “Tabular Figures” (each digit has the same width, suitable for tables) vs. pnum for “Proportional Figures” (digits may have varying widths, as you requested).

Note that this is distinct from, and orthogonal to, the choice of lnum “Lining Figures” vs. onum “Oldstyle Figures”.

The OpenType-capable TeX engines LuaTeX & XɘTeX can access these glyphs if the font you’re using supports those features. Try this example with LuaLaTeX or XeLaTeX:

\documentclass[12pt]{article}
\usepackage{fontspec}
\begin{document}
\fontspec{Linux Libertine O}
{\addfontfeatures{Numbers={Lining,Monospaced}}     0123456789}

{\addfontfeatures{Numbers={Lining,Proportional}}   0123456789}

{\addfontfeatures{Numbers={OldStyle,Monospaced}}   0123456789}

{\addfontfeatures{Numbers={OldStyle,Proportional}} 0123456789}
\end{document}

Output

(The alternate figures in fontspec’s default typeface, Latin Modern Roman, are ugly; avoid them.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.