[Tex/LaTex] \DeclareSymbolFont undesired effect

fontsmath-operators

I would like to have math operator names in Sans Serif.
\DeclareSymbolFont{operators}{OT1}{cmss}{m}{n} does the job but has also an effect on Greek capitals.
How do I change font for operator names keeping the rest of the formatting intact?

Best Answer

If your aim is to change the typesetting of operator names to use sans serif type, you should define a new symbol font:

\documentclass{article}
\usepackage{amsmath}

% a new symbol font for names of operators
\DeclareSymbolFont{sfoperators}{OT1}{cmss}{m}{n}
% don't waste a math group
\DeclareSymbolFontAlphabet{\mathsf}{sfoperators}
% tell LaTeX to use sfoperators for names of operators
\makeatletter
\renewcommand{\operator@font}{\mathgroup\symsfoperators}
\makeatother

\DeclareMathOperator{\foo}{foo}

\begin{document}

$\sin\Gamma+\log(x-\Phi)-\foo(y)$

\end{document}

enter image description here