239

I feel like the standard $\emptyset$ is ugly. By hand, my empty set symbol is a lot rounder, then this "slashed-zero"-type symbol.

Two questions:

  • Do people really use it (I mean people who have any sort of sense of aesthetics)?
  • What alternatives do you suggest?

I seem to recall something closer to what I'm looking for - a slash round-o - but the diameter of the circle seemed too small, I think. (And am I asking this in the right place?)

Display Name
  • 46,933
Jérémie
  • 2,991
  • 13
    I use \emptyset and don't like \varnothing, which is more a symbol for plumbers than mathematicians. :) Michael's advice is pretious: \renewcommand{\emptyset}{...} or \let\emptyset\???, so that you can easily change your mind. – egreg Jul 11 '11 at 20:04
  • 5
    Regarding first question. Go to LaTeX Search and search for \emptyset. You'll get ~1000 docs using it (it is possibly a search limit), so I dare to say it is used. – przemoc Jul 11 '11 at 20:08
  • 1
    egreg: tomayto, tomawto ;-) – Jérémie Jul 11 '11 at 22:38
  • 2
    przemoc: you don't account for poor taste (said jokingly - mostly!). – Jérémie Jul 11 '11 at 22:39
  • 5
    @Jérémie: If you want to reach particular commentator, i.e. be sure it will be notified about it, you have to precede username (at least using 3 first unambiguous characters) with @. Read details regarding it. BTW here I didn't have to address you directly, as you're the OP, so you would be notified anyway. – przemoc Jul 12 '11 at 08:14
  • I am few years late, but I do use this macro: \newcommand{\eset}{\ensuremath{\mathord{\textrm{\usefont{T1}{cmr}{m}{n}\smaller[0.5]\O}}}} to use the letter Ø. – Paolo.Bolzoni Sep 13 '17 at 15:41
  • 1
    @egreg Do you mean that N. Bourbaki was an anonymous group of plumbers with A. Weil as a CEO? ,-) – Denis Sep 13 '20 at 17:09
  • 1
    @Denis I mean that Bourbaki's books are full of bad notation, not just the plumber's symbol. WIth due respect to the members of the group. – egreg Sep 13 '20 at 19:32
  • 1
    @egreg de gustibus non est disputandum. This being said, I'm French and I was raised with Bourbaki's notation. Hence \varnothing seems perfectly right to me whereas \emptyset looks quite weird. – Denis Sep 14 '20 at 04:35

4 Answers4

281

Try \varnothing from the amssymb package. It is perfectly round, and the comprehensive LaTeX symbol list states that it is preferred by many to \emptyset.

\documentclass{article}

\usepackage{amssymb}

\let\oldemptyset\emptyset
\let\emptyset\varnothing

\begin{document}
$\oldemptyset$ $\emptyset$
\end{document}

enter image description here

Michael Ummels
  • 8,604
  • 3
  • 36
  • 27
29

I always just use "\O" in math mode:

$\O$

enter image description here

freb
  • 399
  • 1
    I used to do this, but LaTeX issues a warning if you do this. As such, I prefer \varnothing. – Arun Debray Mar 20 '16 at 03:44
  • 8
    @ArunDebray, this must be what you're referring to: LaTeX Warning: Command \O invalid in math mode on input line 1006. I have so many warnings in my thesis document I don't even notice unless the output halts. Output does look fine though. – freb Mar 20 '16 at 21:41
  • 23
    @freb Ignoring LaTeX warnings is a way to disaster... – yo' Jan 25 '17 at 18:28
  • 9
    Note that Ø (aka \O) is the true origin of the symbol (see this answer ). To avoid the warnings, you can use the amsmath package and \text{\O} (or \text{Ø} if you use latin1 or utf8 encoding, plus a keyboard giving access to this letter). If you tired to type \text everywhere, \newcommand is your friend – Frédéric Grosshans Jul 17 '17 at 14:59
  • 3
    IMHO, still the sexiest empty set on this page. – freb Jan 27 '18 at 07:07
  • 7
    @yo' meh, I'm sure it depends on your use case. I wrote a 50+ page thesis with a million compiler errors but the resulting pdf was exactly what I wanted. So do I spend a few hours just to get clean compiler output? Do we serve the compiler or does it serve us? – eficker Apr 21 '19 at 15:43
9

I find that { } (\{\} in LateX) is perfectly clear to mathematicians, maybe not to computer scientists. I would use the following:

enter image description here

This is obtained with

\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithm}[H]
    \begin{algorithmic}[1]
    \State $myset \gets \{\}$
        \For{$i = 0\, \textbf{to}\, 4$}
            \State {$myset\gets myset\, ||\, (4 - i)$}\Comment{append $i$-th reversed index}
        \EndFor
    \end{algorithmic}
\end{document}

Using \emptyset would give

enter image description here This is obtained with

\begin{algorithm}[H]
\begin{algorithmic}[2]    
    \State $myset \gets \emptyset$
        \For{$i = 0\, \textbf{to}\, 4$}
            \State {$myset\gets myset\, ||\, (4 - i)$}\Comment{append $i$-th reversed index}
        \EndFor
    \end{algorithmic}
\end{algorithm}
pluton
  • 16,421
  • 12
    Why would computer scientists shun from {}. Most are fluent in some programming language(s), and that's the most common syntax for an empty collection. I always figured it would be the other way around. – Neowizard Jan 06 '17 at 08:50
  • 1
    @Xi'an Sorry you fail to see. The questions were: Do people really use it (I mean people who have any sort of sense of aesthetics)? What alternatives do you suggest? – Marco Stamazza Aug 04 '20 at 00:03
  • 1
    The question is about finding a more pleasing rendering of the empty set than \ emptyset, not using another symbol that is not commonly used in mathematics. The first and most voted answer brings a satisfactory solution. – Xi'an ні війні Aug 04 '20 at 07:30
  • Do you really understand that from the question? Amazing the people one can meet on the Internet. In any case, I won't comment on this anymore, other readers can judge, if it worth their time. – Marco Stamazza Aug 06 '20 at 02:14
  • @Neowizard In Python, both dictionaries and sets are created with braces, so they had to decide what {} meant and they made it the empty dictionary (though dict() achieves the same). Anyone familiar with Python, or any other language that made {} something other than a set, would have that as a reason for shunning {} as a synonym for the empty set in mathematics or Python's set(). – J.G. May 26 '22 at 15:48
  • @Neowizard Fine, could have that as a reason. As a fellow Python dev, I don't shun that notation for an empty set either. – J.G. May 31 '22 at 08:47
4

The \diameter is an alternative for emptyset in lines, it is a bit tiny.

\usepackage{wasysym}
\emptyset\diameter

emptyset vs diameter

L F
  • 851