I created commands to display vectors, matrices and tensors. For the tensors I am using a bold italicised math font, which looks exactly as I want for characters. However, when denoting a tensor with a digit, things look inconsistent:
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm}
\DeclareMathAlphabet{\mathsfit}{T1}{\sfdefault}{m}{sl}
\SetMathAlphabet{\mathsfit}{bold}{T1}{\sfdefault}{bx}{sl}
\renewcommand\vec[1] {\bm{\MakeLowercase{#1}}}
\newcommand\mat[1] {\bm{\MakeUppercase{#1}}}
\newcommand\ten[1] {\bm{\mathsfit{\MakeUppercase{#1}}}}
\begin{document}
\begin{tabular}{lcccc}
& scalar & vector & matrix & tensor \\
character & $a$ & $\vec{a}$ & $\mat{a}$ & $\ten{a}$ \\
digit & $1$ & $\vec{1}$ & $\mat{1}$ & $\ten{1}$
\end{tabular}
\end{document}
As you can see, the digits are generally not italicised in the regular math font. However, when using the custom math font for the tensors, they are slanted, which leads to an inconsistent look.
I tried to create a solution with \DeclareMathSymbol
(as in this answer), but this changed all digits (also the scalar, vector and matrix digits).
Is there any way to avoid numbers being italicised for this custom tensor font?