I'm writing a math text in spanish and want to change the definition of the "\mod" command. However, this seems impossible, as the following MWE shows:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\renewcommand{\mod}{\operatorname{changed}}
\begin{document}
$a \equiv b \mod c$
\end{document}
This produces the following output:
However, if I comment the line
\usepackage[spanish]{babel}
in the above code, the result I get is
as I would expect.
The same phenomenon happens with other math operators that carry accents in spanish, like for example "\max" or "\lim", but it works for such that don't have accents, like "\sin".



