3

My question is very similar to lining figures in tables and math, old style figures in text, except I am using the mathpazo font.

I would like to use text figures in the body (through usepackage[osf]{mathpazo}), but want to use lining figures for

  • equations
  • equation number in brackets
  • table of contents
  • page numbers
  • table and figure labels (e.g. the caption: "Fig 1.1: Comparison of ...", I would like "1.1" to use lining figures)
  • tables

For various reasons, I need to use pdftex.

How can I use mathpazo with these requirements? If you have typographical arguments against any of these points, please let me know!

A MWE with only text figures:

\documentclass{memoir}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{amsmath, amsthm, amssymb}
\usepackage[osf]{mathpazo}

\begin{document}

\tableofcontents

\section{Old style numbers}
Old style numbers belong in text 0123456789. Not in in-line equations $\sqrt{4+x^2} = y$
Not in equations:
\begin{align}
    \min_{x,y} &\quad y^2 \\
    \mathrm{s.t} &\quad x > 4\\
        &\quad x < y^2
\end{align}
Nor in tables.

\begin{table}[!htb]
  \caption{mean, median and standard deviation}
  \label{tab:mean}%\libertineTabular
    \begin{tabular}{lccccr}
    \toprule
      climate & species & mean &  median & standard deviation & number of experiments \\
    \midrule
      1 & \textit{Picea abies}  & 20,3699   & 20,0335   & 4,453 & 30 \\
      2 & \textit{Picea abies}  & 23,9864   & 12,6398   & 7,236 & 98 \\
    \bottomrule
  \end{tabular}
\end{table}

\[ a^2 + b^2 = c^2 \qquad 1234567890 \]
Old style numbers belong in text 0123456789.

\section{New section}

\section{Newer section}

\section{Newest section}

\end{document}
  • I've taken the liberty of adding the memoir tag, as this document class has lots of specialized font-handling capabilities. – Mico Apr 20 '18 at 5:19
  • 1
    Are you free to use the newer newpxtext and newpxmath packages in lieu of the somewhat-ancient mathpazo package? – Mico Apr 20 '18 at 5:20
  • @Mico, the OP hasn't manifested themselves on your question. If I may intrude, I would like to hear about newpxtext and newpxmath in this context. – gusbrs Apr 20 '18 at 12:13
  • @gusbrs - Thanks. I'm still hoping that the OP will choose to address my questions. Let's give him/her a bit more time... – Mico Apr 20 '18 at 13:21
  • 1
    @Mico, in the meantime I found this tex.stackexchange.com/a/109960/105447. I asked because I've been fond of Palatino and clones for quite some time, but had dismissed newpx because I like oldstyle figures and the LaTeX Font Catalogue does not even suggest newpx includes them. So, thank you for pointing me to that! – gusbrs Apr 20 '18 at 13:26
2

Your MWE already does old-style numerals in text and lining numerals in equations. That leaves your tables. Since mathpazo uses a Palatino clone as its text font, the easiest way to switch to lining numbers is to switch the font family to a Palatino clone with lining numbers, such as qplr for TeX Gyre Pagella.

If you’re using fontspec or unicode-math (Asana Math is a good OpenType replacement for mathpazo and you can use TeX Gyre Pagella as your matching text font, or you can keep using mathpazo with fontspec or mathspec), it gets even easier. You can get lining, tabular numbers with code like the following example from the fontspec manual:

{\addfontfeatures{Numbers={Monospaced,Lining}}
\begin{tabular}{@{} cccc @{}}
    Year & People & Miles & Boats \\
    \hline  1842 &  999   &  75   &  13   \\
    1923 &  111   &  54   &  56
\end{tabular}}

You can of course encapsulate either macro into something like \tnums or even a new table environment, to make it more semantic and less dependent on a specific package.

The fontspec package also adds both \oldstylenums and \liningnums commands that switch the OpenType font features of the currently-selected font.

Bear in mind that using different numerals for text mode and math mode makes it very obvious which mode you’re writing your numbers in. It’s not clear why these 4 cases is different from x = 4 or which one x equal to 4 should match. Most authors prefer to be consistent within the same document, or perhaps use old-style numerals in specific contexts such as headings or dates.

  • If the tables float memoir has a system to add thst font change to all floating tables. – daleif Apr 20 '18 at 6:33
  • @daleif Wasn’t aware of that. That’s convenient. – Davislor Apr 20 '18 at 11:11
  • 1
    See \setfloatadjustment in the memoir manual – daleif Apr 20 '18 at 11:27
  • Alternative: \newenvironment that wraps the table in a font change? Works in standard LaTeX. – Davislor Apr 20 '18 at 11:49
  • 1
    @Davislor with ppl it looks perfect, so I'll use that. Thanks! – maero21 Apr 22 '18 at 1:49

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.