Numbers look different in text and math mode using newpxmath and newpxtext

fontstypefaces

I use newpxmath and newpxtext font packages:

\documentclass{article}
\usepackage[varbb]{newpxmath}
\usepackage{newpxtext}
\begin{document}
\noindent
Numbers in text mode: 1234\\
Numbers in math mode: $1234$
\end{document}

I noticed that numbers in math mode look differently than in text mode, which is odd:

enter image description here

Is there an easy fix to make the numbers look more consistent in both modes? I noticed that putting numbers into a \text-scope inside math mode works as a workaround, but it's quite cumbersome.

Best Answer

Reverse the order of the package load, as indicated in the documentation:

enter image description here

\documentclass{article}
\usepackage{newpxtext}
\usepackage[varbb]{newpxmath}
\begin{document}
\noindent
Numbers in text mode: 1234\\
Numbers in math mode: $1234$
\end{document}

enter image description here