0

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.

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

1 Answer 1

8

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.