[Tex/LaTex] Change the old style numerals of mathpazo (via tufte-latex) to lining numerals

fontsmathpazooldstylenumstufte

I am using tufte-latex package, which uses mathpazo with old style numerals.
To make figures (plots) I would like to use lining numbers.
The problem is that the figures are converted from svg to pdf using inkscape and the numbers are not in mathmode (In math mode the numbers are lining numerals by default).

I think of two possible solutions:

a) Is there any command similar to \oldstylenums that does the opposite work?

b) inkscape put the text of the figure in \smash{-22.22} commands. Is any way,
using sed, awk, perl,… to change that to \smash{$-22.22}?

Best Answer

The tufte classes load mathpazo with the osf option which defines \rmdefault as pplj (real small caps plus oldstyle numbers). To switch to lining numbers for the whole document, you want pplx (real small caps plus lining numbers).

\documentclass{tufte-book}

\renewcommand{\rmdefault}{pplx}

\begin{document}

0123456789

\end{document}

As an alternative, you may define a \liningnums macro to switch to pplx within a group. Note: the additional pair of braces is necessary to keep the font switch local.

\documentclass{tufte-book}

\newcommand{\liningnums}[1]{%
    {\fontfamily{pplx}\selectfont #1}}

\begin{document}

\liningnums{0123456789}

0123456789

\end{document}