[Tex/LaTex] renewcommand pendant for DefineMathOperator

math-operators

I'd like to change the definition of one of the predefined math operators (\hom).

Is there an equivalent to the \renewcommand statement for operators?

Best Answer

I'm not aware of any pendant, but you can use \DeclareMathOperator (not \DefineMathOperator) a second time if you mark the macro as not defined first. However, changing it doesn't make that much sense, because such a math operator is only there to print the operator name in the correct font. You shouldn't add code or arguments to it. See \DeclareMathOperator won't take arguments for more about that.

\documentclass{article}
\usepackage{amsmath}

\let\hom\relax% Set equal to \relax so that LaTeX thinks it's not defined
\DeclareMathOperator{\hom}{HOM}

\begin{document}

$\hom$

\end{document}
Related Question