218

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?)

9
  • 12
    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, 2011 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, 2011 at 20:08
  • 1
    egreg: tomayto, tomawto ;-)
    – Jérémie
    Jul 11, 2011 at 22:38
  • 1
    przemoc: you don't account for poor taste (said jokingly - mostly!).
    – Jérémie
    Jul 11, 2011 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, 2011 at 8:14

4 Answers 4

255

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

9
  • 2
    Thank you very much, it's exactly the answer that I was looking for.
    – Jérémie
    Jul 11, 2011 at 22:39
  • 75
    Can we all agree that \phi and \Phi should never be used for this? Argh! ;-) Jul 30, 2011 at 8:54
  • 7
    @ColinFraizer I can't believe it. Do people seriously use Phi for empty set? Shocking! May 16, 2013 at 15:22
  • 17
    Just wait until someone sees \phi and doesn't understand it's meant to be "empty set", and uses \varphi in his own documents. My engineering textbook was a nightmare. Dec 1, 2013 at 11:22
  • 11
    @AlfredoHernández Unfortunately, yes. In the wild… (video should start at 4:03; offending statement at 4:17).
    – wchargin
    Nov 11, 2014 at 18:44
25

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

$\O$

enter image description here

6
  • 6
    @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, 2016 at 21:41
  • 19
    @freb Ignoring LaTeX warnings is a way to disaster...
    – yo'
    Jan 25, 2017 at 18:28
  • 7
    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 Jul 17, 2017 at 14:59
  • 3
    IMHO, still the sexiest empty set on this page.
    – freb
    Jan 27, 2018 at 7:07
  • 6
    @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, 2019 at 15:43
7

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}
6
  • 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 6, 2017 at 8: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? Aug 4, 2020 at 0: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. Aug 4, 2020 at 7: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. Aug 6, 2020 at 2: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 at 15:48
4

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

\usepackage{wasysym}
\emptyset\diameter

emptyset vs diameter

1
  • 3
    diameter is another symbol, which is intended for ... diameters in mechanical engineering, plumbing, etc. Jul 17, 2017 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.