Do ℕ, \mathbb{N}, \BbbN, \symbb{N} effectively differ, and is there a "canonical" specification of the naturals?
The difference is mainly historical. \BbbN
was created for the original amsfonts
, pre-LaTeX; it should be considered obsolete now.
(Oops! @egreg points out in a comment that \BbbN
has been defined for unicode-math
, so I was thinking of \Bbb{N}
. That surely should be considered obsolete.)
The original LaTeX equivalent is \mathbb{N}
, and should still be reliable.
\symbb{N}
was defined for fonts developed after the blackboard bold alphabet was added to Unicode.
The symbol itself (which I can't represent because it's not available on the aged laptop I'm using) depends on having a utf-8 capable input device, and is not available for pdflatex, which is still limited to 8-bit input.
All forms are equivalent, and the one you use depends on which flavor of LaTeX you're using. There may also be some restrictions associated with the publisher, if you're submitting your document for publication.
This may not give an unambiguous answer to your question, but it should give you some idea of how the development of the blackboard bold fonts and their support affects the decision of which should be used in what circumstances.
If you modify your file to have
\showoutput
\(ℕ \mathbb{N} \BbbN \symbb{N} \showlists\)
Then you get
\mathord
.\fam0 ℕ
\mathord
.\fam0 ℕ
\mathord
.\fam0 ℕ
\mathord
.\fam0 ℕ
### horizontal mode entered at line 20
Four identical N, same font and same math class (mathord).
I would say use ℕ
if you like Unicode input and \symbb{N}
if you prefer ASCII TeX command markup. So they are the preferred forms, but as they are all the same thing it doesn't matter much which you use.
Of course other font setups may make things differ. In general \symxx
will give you characters from the same font using the math alphabet ranges, whereas \mathxx
might do that or might (as in classic tex) use a different font.
tl;dr
It's completely the same.
Why do those four inputs produce the same output?
In unicode-math-table.tex
we find
\UnicodeMathSymbol{"02115}{\BbbN}{\mathalpha}{/bbb n, open face n}
Every Unicode code point relevant for math has a name, so that unicode-math
can do, in this case, the equivalent of
\Umathchardef`ℕ = "7 "0 "02115
(the second number could change in case range=bb
is used to select a different font for these characters).
If you add \show\mathbb
to your sample TeX file (after \begin{document}
), you'll get
> \mathbb=\long macro:
->\symbb .
This almost answers your question. At least we know that
- typing
ℕ
or\BbbN
is the same - typing
\mathbb{N}
or\symbb{N}
is the same
It only remains to discover what's the relationship between the two cases above. Simple: \symbb{N}
does \BbbN
. Not really by chaining N
to Bbb
, but something like that (it's more complicated because one can use range=bb
to use a different font for blackboard bold letters).
Now we know that typing
$ℕ \BbbN \mathbb{N} \symbb{N}$
is exactly the same. The alias name \mathbb
for \symbb
is for backwards compatibility with older code.
Some explanation is in order. unicode-math
used to have just \mathXX
commands. However, it was realized that distinguishing between \mathXX
and \symXX
is necessary. The first form is about words used in math, the second form for single characters (and doesn't enforce ligatures if used for more characters in a row); these forms can point to different fonts. Typically, for instance, \mathbf
will use the boldface text font, whereas \symbf{x}
will use \mbfx
, pointing to U+1D431 in the math font.
While the distinction is necessary for boldface, in the case of blackboard bold there is no usage of it as a text font, so no distinction is made between \mathbb
and \symbb
, by default. You (or a package) might redefine \mathbb
to do something else (not that I recommend it).
What's the preferred form?
I'd avoid \BbbN
and probably prefer \symbb
for newer documents, unless it's possible to directly type in ℕ
.