Various alternatives to [LaTeX] [Math Symbol] \mathbb{1}: Solution for entering blackboard bold numbers in LaTeX

Intro

Sometimes what if you want to use Blackboard Bold or Double Stroke numbers in LaTeX?Students may have found that using only traditional amssymb or amsfonts packages, they cannot enter lower case letters or numbers in bold black.For example, enter the following code:

\usepackage{amssymb}

$\mathbb{ABCDEFGHIGKLMNOPQRSTUVWSYZ}$
$\mathbb{abcdefghijklmnopqrstuvwxyz}$
$\mathbb{0123456789}$

The output is:

In this case, how to enter functions such as Indicator function?

Solution

To make a long story short is not bb.One more thing: fonts from different packages vary slightly.

1. bbm

Input:

\usepackage{bbm}

$\mathbbm{ABCDEFGHIGKLMNOPQRSTUVWSYZ}$
$\mathbbm{abcdefghijklmnopqrstuvwxyz}$
$\mathbbm{0123456789}$

Output:

For numbers, it seems that only 1 and 2 are supported.

2. dsfont

Input:

\usepackage{dsfont}

$\mathds{ABCDEFGHIGKLMNOPQRSTUVWSYZ}$
$\mathds{abcdefghijklmnopqrstuvwxyz}$
$\mathds{0123456789}$

Output:

It seems odd to behave as lowercase letters only support h and k and numbers only support 1.

3. bbold or mathbbol

Input:

\usepackage{bbold}
% or \usepackage{mathbbol}

$\mathds{ABCDEFGHIGKLMNOPQRSTUVWSYZ}$
$\mathds{abcdefghijklmnopqrstuvwxyz}$
$\mathds{0123456789}$

Output:

It seems normal this time. We all support it.But the font is a little kawayi, which might not fit in the paper?

4. newtxmath

Input:

\usepackage{newtxmath}

$\vmathbb{ABCDEFGHIGKLMNOPQRSTUVWSYZ}$
$\vmathbb{abcdefghijklmnopqrstuvwxyz}$
$\vmathbb{0123456789}$

Output:

PS: Since the above packages such as bbm and dsfont are not on the whitelist of ACM Template, newtxmath can be used here to avoid this problem because newtxmath is already imported by default in the ACM template (acmart).However, if newtxmath is not explicitly imported into your code, \vmathbb{1} will not output the desired results.After further tests by the author, it is found that the output of \vmathbb{s} is the number 1 of the normal blackboard bold.For reader's reference.

Conclusion

The font map is placed below for reference:

Code:

\documentclass{article}

\title{Example of Numbers in Blackboard Bold}
\author{Xovee Xu}
\date{Mar 15, 2020}

\usepackage{amssymb}
\usepackage{bbm}
\usepackage{dsfont}
\usepackage{bbold}
\usepackage{mathbbol}
\usepackage{newtxmath}

\begin{document}

\maketitle

\textbf{bbm}:

$\mathbbm{ABCDEFGHIGKLMNOPQRSTUVWSYZ}$

$\mathbbm{abcdefghijklmnopqrstuvwxyz}$

$\mathbbm{0123456789}$

\textbf{dsfont}:

$\mathds{ABCDEFGHIGKLMNOPQRSTUVWSYZ}$

$\mathds{abcdefghijklmnopqrstuvwxyz}$

$\mathds{0123456789}$

\textbf{newtxmath}:

$\vmathbb{ABCDEFGHIGKLMNOPQRSTUVWSYZ}$

$\vmathbb{abcdefghijklmnopqrstuvwxyz}$

$\vmathbb{0123456789}$

\textbf{bbold} or \textbf{mathbbol}:

$\mathbb{ABCDEFGHIGKLMNOPQRSTUVWSYZ}$

$\mathbb{abcdefghijklmnopqrstuvwxyz}$

$\mathbb{0123456789}$

\end{document}

testing environment

  • Overleaf
    • Overleaf is an online LaTeX editor. If you're interested, you can register with my code of recommendation: https://www.overleaf.com?R=969b656f&rm=d&rs=b
  • pdfLaTeX Compiler

Reference

  1. How do you get \mathbb{1} to work (characteristic function of a set)?. (March 15, 2020). Retrieved from https://tex.stackexchange.com/questions/26637/how-do-you-get-mathbb1-to-work-characteristic-function-of-a-set/532611#532611
Thirty-six original articles were published, 58 were praised, and 40,000 visits were received.
Private letter follow

Posted by dsoukup on Sat, 14 Mar 2020 20:00:30 -0700