This is a follow-up of a previous question I asked before.
I am using newpxtext
and eulerpx
packages, and I want to change the typesetting of operator names to use sans serif type. I implemented egreg's answer:
\documentclass{amsart}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools,newpxtext,eulerpx}
% 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
This works for already defined operator names (\max,\sin,etc.
) and also for custom-defined operatornames (via DeclareMathOperator
). The problem arises when I try to define an operator name involving accents: concretely, I want to define the operator name "máx" (which stands for "máximo", which means "maximum" in Portuguese). The following code
\DeclareMathOperator{\grau}{grau}
\DeclareMathOperator{\mAx}{máx}
\begin{document}
$\deg\quad\grau\quad\max\quad\mAx$
\end{document}
has output
which, besides the fact that the accented "a" is not appearing in sans serif type, generates the warning
'Command \' invalid in math mode on input line ** ',
which is expected, because we must work in math mode instead of text mode. If I use
\DeclareMathOperator{\mAx}{m\acute{a}x}
instead, the output has the same problem as in my previous question:
Trying to implement Davislor's solution
\DeclareMathOperator{\mAx}{m\acute{\mathsf a}x}
does not work, either: it has exactly the same output as before.
Finally, here is a brute-force alternative that works:
\DeclareMathOperator{\mAx}{m\mbox{$\acute{\mathsf a}$}x}
(Obviously, I don't want to resort to this ugly method). Is there some way to solve this issue?
eulerpx
tag? Thanks. – Matemáticos Chibchas Mar 24 '19 at 21:50