You have probably discovered why it's very strongly discouraged to redefine kernel commands with \def
.
For instance, \H
is defined to give the “hungarian umlaut” accent; so, if you are talking about Erdős in your document, you'll get a puzzling error, even if you seem not to be using \H
. Actually when \usepackage[utf8]{inputenc}
is in force, LaTeX translates Erdős
into Erd\H{o}s
. Can you see the problem?
Don't redefine kernel commands unless you know precisely what you're doing. If \newcommand
can't be used, you must check what the command means and, if it turns out to be a command for typesetting accents or similar things, don't redefine it.
It's also particularly bad is adding those commands in a package, even if it's for personal usage. If you pass it to your buddies, they'll start to use it and maybe include it in something they submit elsewhere. As Barbara Beeton observes in a comment,
if a package like this gets submitted with a manuscript to a publisher, it can become very expensive to correct, and may result in rejection of the manuscript.
I should add that she is a great expert (the expert, perhaps) in copy editing for journals and books at the AMS.
You can try saying
\def\box#1{\fbox{#1}}
and see what happens.
Of course, the syntax
\def{\A}{\mathbb A}
is invalid: while \newcommand{\A}{...}
is good, no brace can follow \def
. Irremediably wrong is also
\def\B \mathbb B
which makes really no sense. By the way, the preferred syntax would be \mathbb{B}
with braces that clearly delimit what \mathbb
is applied to.
Simply add the lines
\DeclareSymbolFontAlphabet{\mathbb}{AMSb}
\DeclareSymbolFontAlphabet{\mathbbl}{bbold}
in your preamble and use \mathbbl
instead of \mathbb
for lowercase latin letters.
MWE
\documentclass{article}
\usepackage[bbgreekl]{mathbbol}
\usepackage{amsfonts}
\DeclareSymbolFontAlphabet{\mathbb}{AMSb}
\DeclareSymbolFontAlphabet{\mathbbl}{bbold}
\begin{document}
$\mu = \bbnu(a,b,c)$
$\mathbb{K}$
$\mathbbl{k}$
\end{document}
The reason why simply loading amsfonts
doesn't work is that in amsfonts.sty
you have
\@ifundefined{mathbb}{%
\DeclareSymbolFontAlphabet{\mathbb}{AMSb}%
}{}
which means to set the \mathbb
alphabet to AMSb
only if it has not been defined.
But it has been already defined by mathbbol
to be
\DeclareSymbolFontAlphabet{\mathbb}{bbold}
so it doesn't work without that additional line.
Best Answer
The error message is fairly precise in this case:
Compiling the document gives:
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 useetc.