It seems \Bbb
is obsolete compared to \mathbb
(see this question on Tex.SE), but I've had no problems with \Bbb
, and \Bbb
is shorter than \mathbb
. What are the possible dangers of using \Bbb
, and should we all use \mathbb
?
As commenters said, you can use either one. As far as MathJax is concerned, they are identical (as Peter Krautzberger confirmed). The difference may only transpire if you or someone else exports your posts into a LaTeX document. In that case, you'll be better off with mathbb; but even then the difference is mild.
If your primary goal is to save keystrokes, consider Math Shortcuts userscript, which automatically replaces \ZZ
by \mathbb{Z}
(same for other letters), saving even more keystrokes than \Bbb Z
.
-
1$\begingroup$ But if you wanna write
\Bbb{|N^N|=|R|=|R^N|}
this is far shorter than|\NN^\NN|=|\RR|=|\RR^\NN|
... :-) $\endgroup$ – Asaf Karagila♦ Dec 8 '15 at 22:34 -
$\begingroup$ But the userscript only works on this website. $\endgroup$ – user236182 Dec 9 '15 at 9:35
-
$\begingroup$ @user236182 meta.math.SE is a support site for math.SE, so it evens out. If you want general support for MathJax or LaTeX, you need to look elsewhere... $\endgroup$ – Najib Idrissi Dec 9 '15 at 9:55
-
-
1$\begingroup$ @AsafKaragila You don't want to write
\Bbb{|N^N|=|R|=|R^N|}
when you suddenly change to a font that has blackboard bold glyphs for|
and=
... $\endgroup$ – mrf Dec 11 '15 at 10:22 -
$\begingroup$ @mrf: You have that on this website? I will never write anything like that in my LaTeX files, sure. $\endgroup$ – Asaf Karagila♦ Dec 11 '15 at 10:30
Speaking from the LaTeX side, which is important if one wants to port code from LaTeX to MathJax and conversely.
The command \Bbb
has been deprecated for about 20 years, just like the two letter font selection commands such as \rm
, \it
, \bf
. Classes and packages need not support these commands (notably the memoir
class doesn't by default and the KOMA classes issue warnings and won't support them in some future).
Although \Bbb
has a different status, because it's provided by amsfonts
(loaded automatically by amssymb
) and so doesn't suffer from the same problem as the other deprecated commands, I see a strong reason for not using it: unicode-math
doesn't provide it, but only \mathbb
and \symbb
. And unicode-math
is the future for using OpenType math fonts and all the benefits of Unicode.
In any case, still speaking from the LaTeX side, one should never use \mathbb
directly in a document, but rather define a higher level macro. I usually recommend
\newcommand{\numberset}[1]{{\mathbb{#1}}}
that can be supplemented by other macros such as
\newcommand{\RR}{\numberset{R}}
\newcommand{\NN}{\numberset{N}}
and so on. So changing all number set notation to, say, boldface, is as easy as modifying one line in the document. With these macros, \NN^\NN
is legal and correct.
-
2$\begingroup$ Why should one never use \mathbb directly? $\endgroup$ – Stella Biderman Dec 10 '15 at 23:06
-
$\begingroup$ So...
\math??
font commands are going extinct? $\endgroup$ – Asaf Karagila♦ Dec 10 '15 at 23:12 -
3$\begingroup$ @StellaBiderman For the reason I explained: suppose you're writing your PhD thesis and like
\mathbb
for number sets. One day, your supervisor sends you an email: “Dear Stella, number sets should of course be boldface, not those horrible outlined glyphs.” After an angry stare at the message, you simply change one\mathbb
into\mathbf
and the supervisor will be happy. You can then print your personal copy of the thesis with your favorite glyphs, by changing a single character.:)
The same is true for many other cases. $\endgroup$ – egreg Dec 10 '15 at 23:13 -
$\begingroup$ @AsafKaragila Did I say that? Actually, there's a difference between
\mathbf
and\symbf
inunicode-math
, but it's about multiletter arguments to the macros. $\endgroup$ – egreg Dec 10 '15 at 23:13 -
$\begingroup$ Well, other than the fact that my advisor does not and will not interfere with my choice of fonts or design (and I don't know any advisor that would, at least until I will be an advisor of someone in the future), it seemed that you imply that
\mathbb
will eventually be deprecated, and with it I guessed, perhaps wrongly, that other\math??
fonts will be gone the way of the Dodo bird too. $\endgroup$ – Asaf Karagila♦ Dec 10 '15 at 23:17 -
$\begingroup$ @AsafKaragila I can't see where I implied it:
unicode-math
doesn't provide\Bbb
, but it of course provides\mathbb
and also\symbb
. Switching to Unicode math has some consequences, among which the need of two families of commands,\mathXY
and\symXY
. The details are a bit involved, but\mathXY
commands will certainly remain. $\endgroup$ – egreg Dec 10 '15 at 23:21 -
$\begingroup$ I'd blame the bourbon on my interpretation, but I can't vouch for Stella Biderman's interpretation. So maybe it's both... :-) $\endgroup$ – Asaf Karagila♦ Dec 10 '15 at 23:22
-
$\begingroup$ @AsafKaragila My story about the fussy supervisor is just an example. Making higher level commands helps in planting semantics in the code, which is a good thing. Have you ever had to cope with a thorough change of notation when writing a document? With semantic macros it's much easier. $\endgroup$ – egreg Dec 10 '15 at 23:25
-
$\begingroup$ I know that full well, and of course that I always try that anything used more than twice will be minted into a macro. I'm not disputing that approach. It just seemed at first reading that you're suggesting that
\mathbb
will be gone soon. $\endgroup$ – Asaf Karagila♦ Dec 10 '15 at 23:29 -
$\begingroup$ I take home the advice to write in a higher level macro the command
\mathbb
. Thanks! :) $\endgroup$ – manooooh Oct 5 '18 at 19:41
\Bbb
is that you end up using this (and other\sf\rm\bf
etc.) in your everyday $\LaTeX$ which then generates warnings. If you're not a big fan of warnings from your $\LaTeX$ compiler, then you need to notice that. Otherwise, nobody cares at this point of time. $\endgroup$ – Asaf Karagila♦ Dec 8 '15 at 22:21\mathbb
and\Bbb
is a warning from the compiler. $\endgroup$ – Najib Idrissi Dec 9 '15 at 8:12