4

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

Ingmar
  • 6,690
  • 5
  • 26
  • 47

3 Answers3

6

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}
cfr
  • 198,882
Arun Debray
  • 7,126
  • 2
  • 30
  • 54
1

The cfr-lm package extends Latin Modern with a few symbols such as the slashed zero:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{cfr-lm}

\pagestyle{empty}

\begin{document} o 0 (0) {\zeroslash} O Ø (\Theta) \end{document}

Latin Modern font sample

A few other legacy NFSS packages also contain this symbol.

The fontspec package supports the OpenType slashed-zero font feature, so you can use this with any font that has the feature. You can check whether a given font does with otfinfo -f /path/to/some-file.otf

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}

\setmainfont{Latin Modern Roman} \newcommand\zeroslash{{\addfontfeature{Numbers=SlashedZero}0}}

\pagestyle{empty}

\begin{document} o \oldstylenums{0} \liningnums{0} {\zeroslash} O Ø (\symup\Theta) \end{document}

Latin Modern font sample

I’m afraid Barbara Beeton will not like the shape of the old-style 0 and the lowercase o in Latin Modern.

Davislor
  • 44,045
0

The following command overlaps any two symbols, can be used with a regular O and / to product 0:

\rlap{0}/
Tosha
  • 101