8
$\begingroup$

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?

$\endgroup$
4
  • 1
    $\begingroup$ As it is deprecated, eventually, it might not be supported (by default) anymore. It might also be less well-known, which can cause minor issues for others wanting to edit your post. In sum, I find it slightly bad form to use it, but really only slightlly. $\endgroup$
    – quid Mod
    Dec 8, 2015 at 19:33
  • 1
    $\begingroup$ To add to quid's comment. Keep in mind that MathJax is not TeX, despite striving to be faithful and backward compatible. From a MathJax point of view, the macros are actually identical github.com/mathjax/MathJax/blob/master/unpacked/jax/input/TeX/…. $\endgroup$ Dec 8, 2015 at 21:49
  • 2
    $\begingroup$ To add on to the comment by @Peter, the only real danger of using \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 Mod
    Dec 8, 2015 at 22:21
  • $\begingroup$ In LaTeX the only difference between \mathbb and \Bbb is a warning from the compiler. $\endgroup$ Dec 9, 2015 at 8:12

2 Answers 2

5
$\begingroup$

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 \Z​Z by \mathbb{Z} (same for other letters), saving even more keystrokes than \Bbb Z.

$\endgroup$
6
  • 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 Mod
    Dec 8, 2015 at 22:34
  • $\begingroup$ But the userscript only works on this website. $\endgroup$
    – user236182
    Dec 9, 2015 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$ Dec 9, 2015 at 9:55
  • $\begingroup$ I meant only SE. $\endgroup$
    – user236182
    Dec 9, 2015 at 9:56
  • 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, 2015 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 Mod
    Dec 11, 2015 at 10:30
3
$\begingroup$

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.

$\endgroup$
10
  • 2
    $\begingroup$ Why should one never use \mathbb directly? $\endgroup$ Dec 10, 2015 at 23:06
  • $\begingroup$ So... \math?? font commands are going extinct? $\endgroup$
    – Asaf Karagila Mod
    Dec 10, 2015 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, 2015 at 23:13
  • $\begingroup$ @AsafKaragila Did I say that? Actually, there's a difference between \mathbf and \symbf in unicode-math, but it's about multiletter arguments to the macros. $\endgroup$
    – egreg
    Dec 10, 2015 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 Mod
    Dec 10, 2015 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, 2015 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 Mod
    Dec 10, 2015 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, 2015 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 Mod
    Dec 10, 2015 at 23:29
  • $\begingroup$ I take home the advice to write in a higher level macro the command \mathbb. Thanks! :) $\endgroup$
    – manooooh
    Oct 5, 2018 at 19:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .