[Tex/LaTex] How to format `\delta` as **Bold sloping sans serif font**

fontssans-serif

How can I format \delta as Bold sloping sans serif font. The journal guideline requires that Bold sloping sans serif font, defined by the \mathsfbi macro, should be used for tensors and matrices, for example \mathsfbi{E}. Obviously, it is suited to the normal letter. But when I use \mathsfbi{\delta}, it turns out that there seems no any change. My question is how can I apply it for Greek letter?

Best Answer

You can use the font provided by newtxsf (or another one providing sans serif math):

\documentclass{article}
\usepackage{lmodern,pdftexcmds,amsmath}

\DeclareMathAlphabet{\mathsfbi}{OT1}{\sfdefault}{bx}{sl}
\DeclareMathVersion{sfletters}
\SetSymbolFont{letters}{sfletters}{OML}{ntxsfmi}{b}{it}

\makeatletter
\newcommand{\mathbfsbilow}[1]{%
  \text{\mathversion{sfletters}$\m@th#1$}%
}

\DeclareRobustCommand{\tensor}[1]{%
  \begingroup
  \ifcat\noexpand #1\relax
    % assume Greek letter
    \edef\greek@test{\detokenize{#1}}%
    \edef\greek@test{\expandafter\@cdr\greek@test\@nil}%
    \edef\greek@test{\expandafter\@car\greek@test\@nil}%
    \edef\x{\the\lccode\expandafter`\greek@test}%
    \edef\y{\number\expandafter`\greek@test}%
    \ifnum\x=\y\relax
      % the command name starts with a lowercase letter
      \mathbfsbilow{#1}%
    \else
      \mathsfbi{#1}%
    \fi
  \else
    \mathsfbi{#1}%
  \fi
  \endgroup
}
\makeatother

\begin{document}

$\tensor{T}+\tensor{\Gamma}+\tensor{\delta}$

$\tensor{\alpha}\tensor{\beta}\tensor{\gamma}$

\end{document}

enter image description here