# Invalid Math Operator Declaration in LaTeX

I am trying to define two operators, FM0 and FM4, using the code below \DeclareMathOperator{\FM0}{FM0} \DeclareMathOperator{\FM4}{FM4}

But when I use them as

\FM0(x) = \frac{\PP(x)}{\sum_{i=1}^{N} A(i)} \FM4(x) = \frac{\PP(x)}{\sum_{i=1}^{N} A(i)}

I get this error: "Use of \FM doesn't match its definition"

Is it not allowed to use numbers in the name of math operators? Is there a simple way of defining these operators with numbers in them?

• only letters are allowed in a multi-character "control sequence" (command name). this is a basic tex requirement. – barbara beeton Apr 13 '18 at 18:56

...or you could define \FM as a \mathop that takes an argument.

Without amsmath, here is how:

\documentclass{article}
\newcommand\FM{\mathop{\mathrm{FM#1}}\nolimits}% OR THIS
\newcommand\PP{\mathcal{P}}
\begin{document}
$\FM0(x) = \frac{\PP(x)}{\sum_{i=1}^{N} A(i)}$
$\FM4(x) = \frac{\PP(x)}{\sum_{i=1}^{N} A(i)}$
\end{document}


and with amsmath, egreg suggests an even better way:

\newcommand\FM{\operatorname{FM#1}}


resulting, in either case, with With the \nolimits, sub- and superscripts behave in the manner of \DeclareMathOperator, for example, \FM0_i^2(x): If you remove the \nolimits from the \FM definition (or use the star variant \operator* with the amsmath version), then it behaves like the star version, \DeclareMathOperator*: • Since the OP is clearly loading amsmath, you should too, so you can define \newcommand\FM{\operatorname{FM#1}}, which is much simpler (and much better, for various reasons). Use \operatorname* for limits above and below. – egreg Apr 13 '18 at 20:23

use

\DeclareMathOperator{\FMzero}{FM0}
\DeclareMathOperator{\FMiv}{FM4}

• You mean \FMzero or similar instead of the two tokens \FM and 0? – Heiko Oberdiek Apr 13 '18 at 19:03
• ah sure, didn't realize the 0 ... – user2478 Apr 13 '18 at 19:05
• Yes, this is what I am doing now, but I wished to have the operator name match the operator value. – Kavka Apr 13 '18 at 19:17