Package bbold for mathematical symbol

The bbold package issues:

\DeclareMathAlphabet{\mathbb}{U}{bbold}{m}{n}

But this only makes \mathbb have any effect on so-called variable family type math things, like letters. Things like +, (, ) are not by default of variable family type, hence they don't react to it.


\documentclass{article}
\usepackage{bbold}
\usepackage{mathastext}
\MTnonlettersobeymathxx
\begin{document}

  Mathbb: $\mathbb{+)()}$

  Textbb: \textbb{+)()}

\end{document}

enter image description here

However this will have other effects. Check the mathastext doc how to turn this on also in subdued mode if at all possible.


You can load mathastext in subdued mode. Then you need to move the activation of non-letters to after begin document.

\documentclass{article}
\usepackage{bbold}
\usepackage[subdued, defaultmathsizes, defaultimath, nohbar]{mathastext}
\begin{document}
\MTnonlettersobeymathxx

  Mathbb: $\mathbb{+)()}$

  Textbb: \textbb{+)()}

\end{document}

The impact of mathastext is then kept to a minimal level (but adding basic option would turn off the effect of \MTnonlettersobeymathxx on symbols).

For full details, please refer to Extended scope of the math alphabets commands section in mathastext documentation. In particular, the operators get correct spacing, when everything is inside \mathbb argument :

Examples to show spacing: (only second case gets it wrong)
\[a+b\]
\[a\mathbb{+}b\]
\[a\mathbb{{}+{}}b\]
\[\mathbb{a+b}\]

enter image description here


The other answers have provided you the reasons why \mathbb{+} does not work off-hand. If you would like to use these symbols in a math context, you can declare it as a math symbol, with proper spacings (e.g. + in math mode should have spacing around it matching that of \mathbin because it is a binary operator etc.). See this answer for more details.

In this case, the + is a Math symbol defined in fontmath.ltx as such:

\DeclareMathSymbol{+}{\mathbin}{operators}{"2B}

Motivated by this, you can define the blackboard + math symbol in a similar way, by declaring a symbol font and then a math symbol like so:

\documentclass[12pt]{article}
\usepackage{bbold}

\DeclareSymbolFont{bbsymbol}{U}{bbold}{m}{n}
\DeclareMathSymbol{\bbplus}{\mathbin}{bbsymbol}{"2B}

\begin{document}
    \noindent
    Normal: $a+b$ \\ % No blackboard, correct spacing
    \verb|\bbplus|: $a\bbplus b$ \\ % Blackboard, correct spacing
    \verb|\mathbb|: $a\mathbb{+}b$ % No blackboard, wrong spacing
\end{document}

which gives:

bb

You should be able to extrapolate from this for other symbols by yourself.

Resident font gurus would hopefully correct this or post a new answer if there is an easier way to do this.


According to the documentation for the bbold package:

To use the fonts in LATEX2ε, you select the bbold package, and then use the \mathbb command to get blackboard bold mathematics, \textbb for text, or \bbfamily for longer text.

The code below, which produces

enter image description here

shows that \textbb is more successful with the characters +, (, ):

\documentclass{article}
\usepackage{bbold}
\begin{document}

  Mathbb: $\mathbb{+)()}$

  Textbb: \textbb{+)()}

\end{document}