Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using textlive2014 (and I had the same error in 2013 and before though). Only now I decided to do anything about it.

Whenever I type a formula containing $\o$ I get the warning Command \o is invalid in mathmode. But it displays fine, specifically, it gives the empty set symbol but with a small o instead of O.

What causes this warning? How can it be gotten rid of? Is there now a different command for the empty set with lowercase o instead of \o and the warning means I am using an outdated command? $\O$ never gives me any problems and no problems in the output either way, only a warning in the $\o$ case...

share|improve this question

1 Answer 1

up vote 8 down vote accepted

amssymb defines emptyset

\documentclass{article}
\usepackage{amsmath,amssymb}
\newcommand{\Emptyset}{\text{\o}}
\begin{document}
  \verb|\text{\o}|:
  \[
  \text{\o}
  \]
  %
  \verb|amssymb|'s \verb|\emptyset|:
  \[
  \emptyset
  \]
  %
  \verb|\varnothing|:
  \[
  \varnothing
  \]
  %
  A custom new command \verb|\Emptyset|:
  \[
  \Emptyset
  \]
\end{document}

enter image description here

share|improve this answer
    
Yes, a fix like this works, true. But is there a coding or fragility reason to use \varnothing and not use \o in mathmode directly? There must be some reason a warning is given and the usage \o in mathmode is discouraged, yes? –  Guido Jorg Aug 14 at 5:35
6  
@GuidoJorg \o and \O are categorised as European language symbols, not as math symbols. Hence you can't use them in math mode. –  Harish Kumar Aug 14 at 5:36
5  
@GuidoJorg - the error lies in your use of \o in math mode. You really ought to be using \varnothing or \emptyset. Dedicated math symbols can be endowed with information about any needed extra spacing around them. That's not the case for text-mode "accented" characters. –  Mico Aug 14 at 5:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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