# \DeclareSymbolFont undesired effect

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?

• Welcome to TeX.SX! Are you meaning operators such as sine, cosine and logarithm? – egreg Jun 22 '15 at 10:50
• @egreg Yes, those and custom defined with \operatorname or \DeclareMathOperator – Slava Matveev Jun 22 '15 at 10:57

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}


• Thanks. What do I do, if I want to be able to define operators using different fonts within one document? This is a theoretical question at this point, but for the future reference... – Slava Matveev Jun 22 '15 at 11:04
• @SlavaMatveev \DeclareMathOperator{\baz}{\mathbf{baz}} works. – egreg Jun 22 '15 at 11:05
• Sorry for pestering... What does this \DeclareSymbolFontAlphabet{\mathsf}{sfoperators} do? – Slava Matveev Jun 22 '15 at 11:08