# MWE

Drawing em-boxes at 3 different math styles to make comparison easier:

\documentclass{article}
\usepackage[scaled=1.1]{newtxtext}
\usepackage[scaled=1.1]{newtxmath}
% newtxmath loads amsmath internally, so \text can be used
% It also does \DeclareMathSizes{10}{10}{7.3}{5.5}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{graphicx}

\newcommand{\opticalsizes}[1]{%
\begin{center}
$\null$%
\scalebox{4.015}{%
\rlap{%
\color{red}%
\setlength{\fboxrule}{0.0996264pt}%
\setlength{\fboxsep}{-\fboxrule}%
\fbox{\rule[\dimexpr\the\fontdimen22\textfont2-.5\fontdimen6\textfont2\relax]{0pt}{\the\fontdimen6\textfont2\relax}%
\rule{\the\fontdimen6\textfont2\relax}{0pt}}}%
\rlap{$\textstyle#1$}}%
\hspace{6.0225em}%
\scalebox{5.5}{%
\rlap{%
\color{red}%
\setlength{\fboxrule}{0.0727273pt}%
\setlength{\fboxsep}{-\fboxrule}%
\fbox{\rule[\dimexpr\the\fontdimen22\scriptfont2-.5\fontdimen6\scriptfont2\relax]{0pt}{\the\fontdimen6\scriptfont2\relax}%
\rule{\the\fontdimen6\scriptfont2\relax}{0pt}}}%
\rlap{$\scriptstyle#1$}}%
\hspace{6.0225em}%
\scalebox{7.3}{%
\rlap{%
\color{red}%
\setlength{\fboxrule}{0.0547945pt}%
\setlength{\fboxsep}{-\fboxrule}%
\fbox{\rule[\dimexpr\the\fontdimen22\scriptscriptfont2-.5\fontdimen6\scriptscriptfont2\relax]{0pt}{\the\fontdimen6\scriptscriptfont2\relax}%
\rule{\the\fontdimen6\scriptscriptfont2\relax}{0pt}}}%
\rlap{$\scriptscriptstyle#1$}}%
\hspace{4.015em}\strut%
\end{center}
}

\begin{document}

\section{There are optical sizes for \texttt{\$M\$}}

\opticalsizes{\textit{M}}

\opticalsizes{M}

\section{But none for digits like \texttt{\$1\$}}

\opticalsizes{\text{1}}

\opticalsizes{1}

\end{document}


# My observation

It appears that newtxmath tried to declare math digits using the newtx­text font:

%      \iftx@minion
%      \else % newtxtext
%%      \DeclareMathSymbol{0}{\mathalpha}{letters}{48}
%%      \DeclareMathSymbol{1}{\mathalpha}{letters}{49}
%%      \DeclareMathSymbol{2}{\mathalpha}{letters}{50}
%%      \DeclareMathSymbol{3}{\mathalpha}{letters}{51}
%%      \DeclareMathSymbol{4}{\mathalpha}{letters}{52}
%%      \DeclareMathSymbol{5}{\mathalpha}{letters}{53}
%%      \DeclareMathSymbol{6}{\mathalpha}{letters}{54}
%%      \DeclareMathSymbol{7}{\mathalpha}{letters}{55}
%%      \DeclareMathSymbol{8}{\mathalpha}{letters}{56}
%%      \DeclareMathSymbol{9}{\mathalpha}{letters}{57}
%      \fi


# My question(s)

Can I still use optical sizes for math digits, or are they simply missing in newtx­math?

Yes, the OML fonts in newtxmath have optical sizes (5, 7 and 10). The digits are traditionally not taken from this font because the original OML encoding has the “lowercase digits” (old style) in the relevant positions.

You can get optical sizes for the digits by using the commented declarations:

\DeclareMathSymbol{0}{\mathalpha}{letters}{48}
\DeclareMathSymbol{1}{\mathalpha}{letters}{49}
\DeclareMathSymbol{2}{\mathalpha}{letters}{50}
\DeclareMathSymbol{3}{\mathalpha}{letters}{51}
\DeclareMathSymbol{4}{\mathalpha}{letters}{52}
\DeclareMathSymbol{5}{\mathalpha}{letters}{53}
\DeclareMathSymbol{6}{\mathalpha}{letters}{54}
\DeclareMathSymbol{7}{\mathalpha}{letters}{55}
\DeclareMathSymbol{8}{\mathalpha}{letters}{56}
\DeclareMathSymbol{9}{\mathalpha}{letters}{57}


because the newtxmath fonts do have normal upright digits in those positions. Here's the output, where I used 2 for better seeing the differences (I didn't change the text, which sounds wrong in this case).

• hmm… I wonder why Michael Sharpe decided to commented out those declarations. I’ll phrase the weird scaling problem in a new post. – Ruixi Zhang Jul 2 '18 at 16:49