[Tex/LaTex] How to write “computer zero” (with slanted vertical line) in TeX

math-mode

In TeX, how is a “computing zero” sign written, with a slanted vertical line through it?

Best Answer

It depends exactly what you mean by "computer zero." I'd guess you mean a slashed zero in a monospaced font; you can obtain this by choosing a font that has a slashed zero in its \texttt series and writing $\texttt 0$; for example, Anonymous Pro will work by adding this to your preamble:

\usepackage[T1]{fontenc}
\usepackage[ttdefault=true]{AnonymousPro}

slashed zero

Alternatively, if you want a symbol for the empty set, try \emptyset or \varnothing using the amssymb package.

Here's a comparison of all three:

enter image description here

Here's the code I used, showing the packages you need.

\documentclass{standalone}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[T1]{fontenc}
\usepackage[ttdefault=true]{AnonymousPro}
\begin{document}

\verb+\emptyset+: $\emptyset$

\verb+\varnothing+: $\varnothing$

\verb+\mathtt O+: $\texttt 0$

\end{document}
Related Question