[Tex/LaTex] mathpazo old-style figures and eulervm: I want lining figures in math

eulervmmath-modemathpazooldstylenums

I would like to use Palatino with small caps and old-style figures
for text and Euler with euler-digits for math.

If I use \usepackage[sc,osf]{mathpazo} without eulervm I get
old-style figures in text mode and lining figures in math mode, which
is what I want.

If I add \usepackage[euler-digits]{eulervm} I get old-style figures
in text mode, euler digits for \mathnormal and \mathbold but also
pazo old-style figures for \mathrm , \mathit , and \mathbf , which
I do NOT want.

It seems eulervm 'switch back' to text font (with old-style figures)
for \mathrm , \mathit , and \mathbf . I'd like it to 'switch back'
to lining figures font.

How could I get

  • pazo's old-style figures in text mode,
  • euler-digits in math mode for \mathnormal ,
  • pazo's lining figures in mathmode for \mathrm , \mathit , and \mathbf ?

I really do not want old-style figures in math mode.

%%%% ECM mathpazo osf and eulervm

\documentclass{minimal}

\usepackage[utf8]{inputenc}
% mathpazo osf alone gives old-style figures in text mode
% and lining figures in math mode  :-)
\usepackage[sc]{mathpazo}
% eulervm 'switch back' to pazo's old-style figres  :-(
\usepackage[euler-digits]{eulervm}
\usepackage[T1]{fontenc}
\usepackage{mathtools}

\begin{document}

Mathpazo text: 1234567890 old-style figures OK.

Euler math with euler-digits:
\begin{align*}
1234567890  \qquad &\text{mathnormal: euler-digits OK}  \\
\mathrm{1234567890}  \qquad &\text{mathrm: pazo old-style figures KO}  \\
\mathit{1234567890}  \qquad &\text{mathit: pazo old-style figures italic KO}  \\
\mathbf{1234567890}  \qquad &\text{mathbf: pazo old-style figures bold KO}  \\
\mathbold{1234567890}  \qquad &\text{mathbold: euler-digits OK}
\end{align*}

\end{document}

%%%% End of ECM

Best Answer

You have to use "lining figures" fonts for the math alphabets: add the following lines before \begin{document}:

\DeclareSymbolFont{operators}{\encodingdefault}{ppl}{m}{n}
\DeclareMathAlphabet{\mathbf}{\encodingdefault}{ppl}{bx}{n}
\DeclareMathAlphabet{\mathit}{\encodingdefault}{ppl}{m}{it}

so that the alphabets chosen by \mathrm, \mathbf and \mathit will use the family ppl rather than the default family.

Example

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[sc,osf]{mathpazo}
\usepackage[euler-digits]{eulervm}
\usepackage[T1]{fontenc}
\usepackage{mathtools}

\DeclareSymbolFont{operators}{\encodingdefault}{ppl}{m}{n}
\DeclareMathAlphabet{\mathbf}{\encodingdefault}{ppl}{bx}{n}
\DeclareMathAlphabet{\mathit}{\encodingdefault}{ppl}{m}{it}

\begin{document}

Mathpazo text: 1234567890 old-style figures OK.

Euler math with euler-digits:
\begin{align*}
1234567890  \qquad &\text{mathnormal: euler-digits OK}  \\
\mathrm{1234567890}  \qquad &\text{mathrm: pazo old-style figures OK}  \\
\mathit{1234567890}  \qquad &\text{mathit: pazo old-style figures italic OK}  \\
\mathbf{1234567890}  \qquad &\text{mathbf: pazo old-style figures bold OK}  \\
\mathbold{1234567890}  \qquad &\text{mathbold: euler-digits OK}
\end{align*}$

\end{document}

enter image description here