92

The blackboard bold font in the AMSFonts package only has capital letters. I sometimes wish to use a blackboard bold "1", for which I can use \usepackage{bbold}. But this changes the entire blackboard bold font, and I like the original AMSFonts versions of the capital letters better. Is there a simple way for me to get \mathbb{1} from one package and the blackboard bold capitals from another?

Mark Meckes
  • 17,791

5 Answers5

58

This doesn't exactly answer your question (how to use bbold with AMS's black board bold characters). I believe that would require some TeX incantations.

A cheaper work around is to use either the package bbm or the package doublestroke. The former defines the \mathbbm command and the latter uses the \mathds command, so they don't conflict with the AMS \mathbb. Also asthetically I prefer the bbm fonts over bbold since the latter is sans serif, which doesn't quite fit in right against the AMS serifed fonts.

vlopez
  • 138
Willie Wong
  • 24,733
  • 8
  • 74
  • 106
  • That may not answer the question precisely as I asked it, but it tells me how to do what I want to do. The sans serif issue is also my aesthetic complaint with the bbold font. – Mark Meckes Jul 28 '10 at 16:58
  • 9
    @MarkMeckes: Note that \mathbbm selects a Type 3 font whereas \mathds selects a Type 1 font. – mhp Sep 03 '11 at 21:08
  • 2
    @mhp please could you give a reference for what you mean by these font types? Is there a significant distinction? – Morgan Rogers Jul 28 '17 at 14:24
  • @MorganRogers: the types refers to PostScript font types (see e.g. Wiki https://en.wikipedia.org/wiki/PostScript_fonts and references there). In terms of the underlying technology (subset of PostScript used, and features supported) there are some differences. From the user's point of view the main issue is that some software do not support the use of Type 3 fonts. This can be an issue when, for example, preparing a PDF manuscript for submission to a journal, whose online processing system cannot deal with Type 3 fonts. – Willie Wong Aug 29 '18 at 18:10
39

I had the same question about a year ago. I came up with the following solution, which seems a bit cleaner that Juan's "hack":

\DeclareSymbolFont{bbold}{U}{bbold}{m}{n}
\DeclareSymbolFontAlphabet{\mathbbold}{bbold}

Then one can use $\mathbbold{1}$ (and I store this, without the dollar signs, in the macro \ind since I use it as an indicator function).

Hendrik Vogt
  • 37,935
  • I wanted to do this outside of math mode; however, when I try this, I get the error: LaTeX Error: \prettytext allowed only in math mode. – Alex Jan 03 '20 at 12:47
18

You've already got a pretty good answer. Just in case you really wanted to use amsmath and bbold, the following TeX-hack seems to do the trick.

\usepackage{amsmath}
\usepackage{amsfonts}
\makeatletter
\def\amsbb{\use@mathgroup \M@U \symAMSb}
\makeatother

\usepackage{bbold}

\begin{document}
$\mathbb{1}, \amsbb{X}$
\end{document}
Juan A. Navarro
  • 62,139
  • 32
  • 140
  • 169
  • Well, I don't really want to do that, but I may well find myself wanting to use a similar hack for a different purpose sometime. – Mark Meckes Jul 28 '10 at 18:00
5

Here is another way to do what you want that leaves \mathbb using the AMS fonts.

\newcommand{\bbfamily}{\fontencoding{U}\fontfamily{bbold}\selectfont}
\DeclareMathAlphabet{\mathbbold}{U}{bbold}{m}{n}

You can then use \mathbbold for the bbold math fonts.

Adam Liter
  • 12,567
0

I recommend using the following format. You may also check this link for various packages which offers different kind of solution.

\documentclass{article}
\usepackage{bbold}

\begin{document} \begin{itemize} \item $\mathbb{1}_X$ \item $\mathbb{\Omega}$ \item $\mathbb{\Delta}$ \end{itemize}

\end{document}

Blackboard Characters

akr_
  • 159
  • 1
    This doesn't answer the question at all. The OP was already using bbold, and wanted to avoid it changing the whole blackboard bold font. – rbrignall Nov 10 '22 at 11:12