Why can't I use \DeclareMathOperator{\H}{\mathbb H}?

Is there a reason why I cant use \DeclareMathOperator{\H}{\mathbb H}?

\H is not defined normally, so why can I define this?

\DeclareMathOperator{\R}{\mathbb R} and others similar work just fine.

• mathbb needs amsfonts. Also, it is strange to define \mathbb{R} as a math operator. Maybe you want simply a \newcommand{\R}{\mathbb{R}}. Nov 19, 2017 at 18:45
• \H: macro:#1->{\accent "7D #1} is defined. Nov 19, 2017 at 18:46

The error message is fairly precise in this case:

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\H}{\mathbb H}
\begin{document}
$\H a$
\end{document}


Compiling the document gives:

! LaTeX Error: Command \H already defined.
Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.3 \DeclareMathOperator{\H}{\mathbb H}


which is telling you that \H is already defined.

There are also other single letter commands (e.g., \A). In general, it is better to avoid defining your own single letter commands. Instead use \RR, \HH, etc.

Also, as @Sigur pointed out, it does not make sense to define \mathbb{R} or \mathbb{H} as a math operator. It is better to use

\newcommand\RR{\mathbb R}
\newcommand\HH{\mathbb H}


etc.

• It is sad that the cli does not tell us in which file \H is already defined. Is it safe to use renewcommand? May 16 at 10:53