我如何格式化\delta
为粗体斜体无衬线字体. 期刊指南要求粗体斜体无衬线字体宏定义的\mathsfbi
应该用于张量和矩阵,例如\mathsfbi{E}
。显然,它适合普通字母。但是当我使用 时\mathsfbi{\delta}
,结果似乎没有任何变化。我的问题是如何将它应用于希腊字母?
答案1
您可以使用提供的字体newtxsf
(或另一个提供无衬线数学的字体):
\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}