6

I want to be able to use the \oldstylenums{} command as a default way for display my numbers, but only outside of math mode. Is this possible to do? I know some fonts come with this numbering system, but is there a way to make the old style the default way for displaying numbers in, let's say, the default font?

Thanks greatly!

Edit: MNW

\documentclass[a4paper,12pt]{extarticle}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[a4paper,margin=1.5in]{geometry}
\begin{document}
This is a document in the default font, made on 12/3/2014. The numbers in this document need to be in the Old English style (where the number's height differs from each other).
$$\text{This is a math block. These numbers should display as modern English style:}12/3/2014}$$
\end{document}
  • Yes. Provide a minimal example (or see here) and a solution will be posted more quickly. – jon Dec 4 '14 at 1:33
  • @jon My computer simply hates me (wont let me view the 2nd link). Will it be enough to post code? Or to put a picture of sorts? – Conor O'Brien Dec 4 '14 at 1:35
  • Yeah, just the code for a "minimal" document. In this case, probably just the font-related packages. – jon Dec 4 '14 at 1:48
  • It depends of the typography you're using, that's why you need to submit a MWE. In my case, I use to work with mathpazo that is a font for LaTeX based on Palatino (by Hermann Zapft) but extended for use it with maths. So I load it as a package: \usepackage{mathpazo}. When I want to add old style figures and small capitals I add them as options, i.e. \usepackage[osf,sc]{mathpazo} and that's all. You can get it also using XeLaTeX or LuaLaTeX if you use an OpenType font with that option available. – Aradnix Dec 4 '14 at 1:49
  • 2
    Then cfr-lm is the package you want. (I am, however, somewhat biased!) See basic example in my answer. You can tweak the options if you take a look at the documentation (texdoc cfr-lm). For example, you can choose tabular or proportional, and lining or oldstyle for each of the default font families, switch between different styles of figures at will etc. – cfr Dec 4 '14 at 2:23
9

This uses Latin Modern which is a revised version of Computer Modern.

\documentclass[a4paper,12pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{cfr-lm}
\begin{document}
This is a document in the default font, made on 12/3/2014. The numbers in this document need to be in the oldstyle figures, which means that some numerals drop below the baseline.
\[\text{This is a math block. Lining numbers:}12/3/2014\]

{\lstyle To temporarily switch to lining figures, you can use \verb|\lstyle| which will produce 0123456789.
  \tstyle To temporarily switch to tabular figures, you can use \verb|\tstyle| which will produce 0123456789 if lining figures are active or \ostyle 0123456789 if oldstyle are being used.}

{\plstyle\verb|\plstyle| explicitly requests proportional, lining figures such as 0123456789}. {\tlstyle\verb|\tlstyle| explicitly requests tabular, lining figures such as 0123456789.} {\postyle\verb|\postyle| explicitly requests proportional, oldstyle figures such as 0123456789} and {\tostyle\verb|\tostyle| explicitly requests tabular, oldstyle figures such as 0123456789.}

Alternatively, commands such as \verb|\textpl{}| will typeset their argument using the relevant style:
\begin{quote}
  \textpo{0123456789} \verb|\textpo{0123456789}|

  \textto{0123456789} \verb|\textto{0123456789}|

  \textpl{0123456789} \verb|\textpl{0123456789}|

  \texttl{0123456789} \verb|\texttl{0123456789}|
\end{quote}

\end{document}

osf in text only

Note that, as Mico points out, this has nothing to do with Old English which is a historical ancestor of contemporary English, used long, long before figures were typeset in any style at all! Usually, these figures are called oldstyle (OSF) or sometimes just text or hanging, while the more modern-looking ones are described as lining.

Oldstyle figures are usually, but not necessarily, also proportional i.e. a figure '1' has a smaller width than a figure '8', for example. In contrast, tabular figures have equal widths. Latin Modern actually provides oldstyle tabular and lining proportional figures, as well as oldstyle proportional and lining tabular. This is worth bearing in mind as it affects the options for cfr-lm and the effect of font commands which switch between styles.

For example:

\usepackage[rm={lining,proportional},sf={lining,proportional},tt={lining,proportional,variable}]{cfr-lm}

will use lining, proportional figures as default - not lining tabular.

  • Perfect! Just what I needed! Thanks bunches! – Conor O'Brien Dec 4 '14 at 2:22

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.