How do you get \mathbb{1} to work (characteristic function of a set)?

Since \mathbb doesn't support digits (with amssymb or txfonts) you may use bbm

\documentclass{article}
\usepackage{bbm}
\begin{document}
\[ \mathbbm{1} \]
\end{document}

bbm example

or dsfont, the doublestroke package:

\documentclass{article}
\usepackage{dsfont}
\begin{document}
\[ \mathds{1} \]
\end{document}

dsfont example


Another option is to use bbold package.

\documentclass{article}
\usepackage{bbold}
\begin{document}
\[ \mathbb{1} \]
\end{document}

bbold example

Though it ruins the letters.


I'm surprised no one has mentioned this, but you can use the unicode-math package. Note that you need Xe(La)TeX or LuaLaTeX to use this package.

\documentclass{article}

\usepackage{amsmath}
\usepackage{unicode-math}

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

enter image description here