9

I am trying to typeset double-struck digits in math mode. They have to come from the same font.

I tried

\mathbbm{0}

from the bbm package and

\mathds{0}

from the dsfont package.

The document compiles OK, but the characters do not show up. Interestingly, the versions for 1 do work.

The minimal examples are:

\documentclass{article}
\usepackage{dsfont}
% or: \usepackage{bbm} with mathbbm below
\begin{document}
$\mathds{0}$  % doesn't print
$\mathds{1}$  % prints
\end{document}

The log file has error messages of the kind:

Missing character: There is no 0 in font bbm10!

I guess that's the problem, but I don't know how to fix it.

5
  • 1
    Please help us to help you and add a minimal working example (MWE) that illustrates your problem. In particular, it is important to see which packages and fonts you are loading. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – darthbith
    Oct 7, 2014 at 15:35
  • 1
    Did you happen to notice messages such as Missing character: There is no 0 in font bbm10! and Missing character: There is no 0 in font dsrom10! in the log file?
    – Mico
    Oct 7, 2014 at 15:39
  • @darthbith I have added the MWE.
    – ziutek
    Oct 8, 2014 at 11:45
  • @Mico Thanks, I have added output from the log file.
    – ziutek
    Oct 8, 2014 at 11:45
  • 1
    @ziutek - So there you have it: the dsfont and \bbm packages simply don't provide a double-struck (aka blackboard bold) 0. I suggest you peruse the documentation of the mathalfa package to choose a font package that does feature a double-struck 0 -- and 1.
    – Mico
    Oct 8, 2014 at 11:55

3 Answers 3

8

Thanks to @Mico, I found the following solution.

\documentclass{article}
\usepackage[bb=boondox]{mathalfa}
\begin{document}
$\mathbb{0}$ $\mathbb{1}$
\end{document}

enter image description here

7

I think the most elegant version (since it does not overwrite \mathbb) is the following:

\DeclareMathAlphabet{\mymathbb}{U}{BOONDOX-ds}{m}{n}
\begin{document}
    $\mymathbb{0}$ \\
    $\mymathbb{1}$
\end{document}

see Use both boondox-ds and the blackboard fonts from amsfonts

2
  • 3
    Btw, use \DeclareMathAlphabet{\mymathbb}{U}{bbold}{m}{n} to use the bbold font instead of boondox
    – dafrick
    Nov 6, 2017 at 12:40
  • bbold is serif while boondox is sans-serif. Jan 20 at 9:30
3
\usepackage{bbold}

\begin{document}
$\mathbb{0}$ \\
$\mathbb{1}$
\end{document}

This also works. It's not the same font as used in the mathalfa package, but it also produces double struck 0s and 1s.

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