A package for using the bbm fonts in math environment

Torsten Hilbrich^{∗}

Printed March 18, 1999

1 Introduction

Did you ever write mathematical text and needed a character specifying the set of natural numbers? One opportunity is to use the bbold font of AMS. But this is rather an outlined than a double-striked font.

I found some fonts, called bbm which are available in roman, sans serif and typewrite type and look like those you would write on paper, double-striked left side and normal right side.

2 How to use these fonts?

You simple have to input the package bbm by typing the following:

 \usepackage{bbm}

\mathbbm The fonts can now be used in math environment by typing $\mathbbm{N}$ for getting the symbol for natural numbers: ℕ. This is the same methode like for getting a calligraphic N where you use $\mathcal{N}$.

The characters can be used as index or superscript as well. Let’s see: M_{𝕚} was created with the following sequence.

 $M_\mathbbm{i}$

Do you prefer a sans serif font for sets, or even a typewrite style? No problem,

\mathbbmss the commands \mathbbmss and \mathbbmtt do the same like \mathbbm except of

\mathbbmtt using the specified font.

Examples:

 \mathbbm{N}  ℕ
 \mathbbmss{N} ℕ
 \mathbbmtt{N} �

∗Torsten.Hilbrich@gmx.net

Some often used sets can be described with the following letters: ℕ, ℝ, ℤ, ℝ, ℚ, and ℂ.

2.1 What about bold symbols?

By typing \mathbold or \mathversion{bold} you switch to the bold variant of some math symbols. The selection of math version must be done outside the math environment. Two of the fonts described above are available in bold extended series too, the roman and sans serif family. If you specify \mathbold before using the symbols, you can use bold letters. Let’s see the examples again, now in bold version:

 \mathbbm{N}  �
 \mathbbmss{N} �
 \mathbbmtt{N} �

3 Where to get the fonts?

The fonts can be found at CTAN^{1}, the directory is /tex-archive/fonts/cm/bbm. The BBM directory on CTAN contains a link to this location.

4 Implementation

Here the driver file for the documentation.

1 ⟨∗driver⟩

 2 \documentclass{ltxdoc}
 3 \setlength{\parskip}{1ex plus 0,5ex minus 0,2ex}
 4 \setlength{\parindent}{0pt}
 5 \usepackage{bbm}
 6 \begin{document}
 7 \DocInput{bbm.dtx}
 8 \end{document}

9 ⟨/driver⟩

4.1 The style file

I simply declare some new math alphabets. If you want to now more about the font selection used by L^{A}TEX 2ε you should read fntguide.tex which is part of the distribution.

Some identification stuff

10 ⟨∗package⟩

11 \NeedsTeXFormat{LaTeX2e}
12 \ProvidesPackage{bbm}[\filedate\space V\space\fileversion
13  \space provides fonts for set symbols - TH]

1e.g. ftp.dante.de

First I declare \mathbbm as new math alphabet:

14 \DeclareMathAlphabet{\mathbbm}{U}{bbm}{m}{n}

and set the bold version of this font:

15 \SetMathAlphabet\mathbbm{bold}{U}{bbm}{bx}{n}

I decided to use the encoding U because the fonts aint complete. The contain lower and upper letters, the digits 1 and 2, brackets and parentheses.

The same definition is repeated for bbmss

16 \DeclareMathAlphabet{\mathbbmss}{U}{bbmss}{m}{n}
17 \SetMathAlphabet\mathbbmss{bold}{U}{bbmss}{bx}{n}

The typewrite font has no bold version those it’s declared by

18 \DeclareMathAlphabet{\mathbbmtt}{U}{bbmtt}{m}{n}

19 ⟨/package⟩

4.2 The font definition files

L^{A}TEX 2ε knows now new math alphabets called bbm, bbmss and bbmtt. But it don’t know, which files contains the information of the fonts. Font definition files (the files with extension .fd) are needed to inform L^{A}TEX 2ε about the new fonts. The whole mechanism of these files can be found in fntguide.tex in section 4.

20 ⟨∗bbm⟩

21 \ProvidesFile{ubbm.fd}[\filedate\space V\space\fileversion
22  \space Font definition for bbm font - TH]
23 \DeclareFontFamily{U}{bbm}{}
24 \DeclareFontShape{U}{bbm}{m}{n}
25 {  <5> <6> <7> <8> <9> <10> <12> gen * bbm
26  <10.95> bbm10%
27  <14.4>  bbm12%
28  <17.28><20.74><24.88> bbm17}{}
29 \DeclareFontShape{U}{bbm}{m}{sl}
30 {  <5> <6> <7> bbmsl8%
31  <8> <9> <10> <12> gen * bbmsl
32  <10.95> bbmsl10%
33  <14.4> <17.28> <20.74> <24.88> bbmsl12}{}

As an example I will explain the following part.

34 \DeclareFontShape{U}{bbm}{bx}{n}
35 {  <5> <6> <7> <8> <9> <10> <12> gen * bbmbx
36  <10.95> bbmbx10%
37  <14.4> <17.28> <20.74> <24.88> bbmbx12}{}

The first line means: the sizes 5, 6, 7, 8, 9, 10, 12 point can be directly generated because these fonts are available. The next line replaces the 10.95pt by the 10pt sized font scaled to 10.95pt size. All fonts greater than 12pt are scaled to the proper size using the 12pt font.

38 \DeclareFontShape{U}{bbm}{bx}{sl}
39 {  <5> <6> <7> <8> <9> <10> <10.95> <12> <14.4> <17.28>%

40  <20.74> <24.88> bbmbxsl10}{}
41 \DeclareFontShape{U}{bbm}{b}{n}
42 {  <5> <6> <7> <8> <9> <10> <10.95> <12> <14.4> <17.28>%
43  <20.74> <24.88> bbmb10}{}

44 ⟨/bbm⟩

The definitions are quite long, I know. Let’s pick out the definition

 \DeclareFontShape{U}{bbm}{bx}{n}

The first line means: in the sizes 5, 6, 7, 8, 9, 10, 12 point you can directly generate the fonts because this sizes are available. The next line replaces the 10.95pt by the 10pt sized font scaled to the needed size. 14.4pt sized font can be generated using 12pt size at magstep 1. All sizes greater than 14.4pt are scaled using the 17pt font.

Here are the other definitions:

45 ⟨∗bbmss⟩

46 \ProvidesFile{ubbmss.fd}[\filedate\space V\space\fileversion
47  \space Font definition for bbmss font - TH]
48 \DeclareFontFamily{U}{bbmss}{}
49 \DeclareFontShape{U}{bbmss}{m}{n}
50 {  <5> <6> <7> bbmss8%
51  <8> <9> <10> <12> gen * bbmss
52  <10.95> bbmss10%
53  <14.4> bbmss12%
54  <17.28> <20.74> <24.88> bbmss17}{}
55 \DeclareFontShape{U}{bbmss}{m}{it}
56 {  <5> <6> <7> bbmssi8%
57  <8> <9> <10> <12> gen * bbmssi
58  <10.95> bbmssi10%
59  <14.4> bbmssi12%
60  <17.28> <20.74> <24.88> bbmssi17}{}
61 \DeclareFontShape{U}{bbmss}{bx}{n}
62 {  <5> <6> <7> <8> <9> <10> <10.95> <12> <14.4> <17.28>%
63  <20.74> <24.88> bbmssbx10}{}

64 ⟨/bbmss⟩

The typewrite font is even purer since it contains only the medium series normal shape characters.

65 ⟨∗bbmtt⟩

66 \ProvidesFile{ubbmtt.fd}[\filedate\space V\space\fileversion
67  \space Font definition for bbmss font - TH]
68 \DeclareFontFamily{U}{bbmtt}{}
69 \DeclareFontShape{U}{bbmtt}{m}{n}
70 {  <5> <6> <7> bbmtt8%
71  <8> <9> <10> <12> gen * bbmtt
72  <10.95> bbmtt10%
73  <14.4> <17.28> <20.74> <24.88> bbmtt12}{}

74 ⟨/bbmtt⟩