# \subseteq + \circ as a single symbol (“open subset”)

I'm trying to create symbols \opn for "open subset" and \cls "closed subset". I want them to look like this:

My current solution is:

\def\opn{\!\ensuremath{\subseteq\!\!\!\!\!\raisebox{1pt}{$\circ$}}\,}
\def\cls{\!\ensuremath{\subseteq\!\!\!\!\!\raisebox{1pt}{$\bullet$}}\,}


But the problem is when I use this, Latex doesn't treat \subseteq and \circ as a single symbol, so the spacing is incorrect when for example I write $U~\!\!\!\opn\!\!\!~X$:

How can I make the position of the circle be fixed in the middle, so that \opn becomes a single symbol that is resizable, i.e. responds well to \huge?

Edit: @egreg @MartinScharrer: When using your command (to define the stalk of a sheaf)

\mathcal{F}_x:=\frac{\bigsqcup\{\mathcal{F}(U);\, x\in U \opn X\}}{s\sim s'
\,\Longleftrightarrow\, s\in\mathcal{F}(U)\text{ and }s'\in\mathcal{F}(U')\text{ and }
\exists x\in W \opn U\cap U'\!:s|_W=s'|_W}


I get ugly results, namely (egreg's solution)
and (Martin Scharrer's solution) .

Currently, I like this edited Martin's solution the most aesthetically appealing:

\def\opn{ \ensuremath{\mathrel{\subseteq \!\!\!\!\!\raisebox{1.63pt}{$\scriptstyle\circ$}}}}    %odprta podmnozica
\def\opnn{\ensuremath{\mathrel{\subsetneq\!\!\!\!\!\raisebox{1.63pt}{$\scriptstyle\circ$}}}}    %prava odprta podmnozica
\def\cls{ \ensuremath{\mathrel{\subseteq \!\!\!\!\!\raisebox{1.63pt}{$\scriptstyle\bullet$}}}}  %zaprta podmnozica
\def\clsn{\ensuremath{\mathrel{\subsetneq\!\!\!\!\!\raisebox{1.63pt}{$\scriptstyle\bullet$}}}}  %prava zaprta podmnozica


but there is still a problem in the above code. Could anyone edit this last code to fix the problem with spacing?

-
One should never use negative spacing like \! for something like this; see this answer of mine for details. – Hendrik Vogt Jun 15 '12 at 17:31

Here is a possibility:

\newcommand\opn{\mathrel{\ooalign{$\subseteq$\cr
\hidewidth\raise.225ex\hbox{$\circ\mkern.5mu$}\cr}}}
\newcommand\cls{\mathrel{\ooalign{$\subseteq$\cr
\hidewidth\raise.225ex\hbox{$\bullet\mkern.5mu$}\cr}}}


The symbols will change size according to the context. They don't reduce in subscript or superscripts, for that something more is needed.

\mathcal{F}_x:=
\frac{\bigsqcup\{\mathcal{F}(U);\, x\in U \opn X\}}
{\exists x\in W \opn U\cap U'\!:s|_W=s'|_W}
$\bigskip$\displaystyle\opn\cls
\scriptscriptstyle\opn\cls\end{document}  (I've simplified your formula just to show the effect of the new symbol; however, such a big formula should always be typeset in display style and with \dfrac.) - Great answer, as always. The \ooalign is very interesting. – Martin Scharrer Jul 5 '11 at 12:53 Thank you very much. I'm don't really understand what your code actually does, but I'll study it when the need to construct another sign comes. In the meantime, I'll be happily using this one. Again, thank you very much :). – Leon Lampret Jul 5 '11 at 12:57 @Leon: It's similar to a tabular (which uses \halign internally), but the alignment is different (overlayed instead table structure). The \cr stands for the line end, i.e. like \\. But egreg can it of course explain better. – Martin Scharrer Jul 5 '11 at 13:11 I've added some words about \ooalign. – egreg Jul 5 '11 at 13:33 There is a problem (see edit). Would you be willing to fix it? – Leon Lampret Mar 22 at 5:39 show 3 more comments Obligatory Unicode answer: With XeLaTeX or LuaLaTeX with the unicode-math package, you can use ⟃ (i.e. U+27C3 OPEN SUBSET) directly (or use the alias \subsetcirc). There is also ⪽ (U+2ABD SUBSET WITH DOT; \subsetdot) and ⫏ (U+2ACF CLOSED SUBSET; \csub). Unicode doesn't seem to contain a subset symbol with a bullet inside. - You need to place your symbol inside \mathrel{..} so it is taken as a relation symbol. To support different size you should define \raisebox using the ex unit instead. \def\opn{\ensuremath{\mathrel{\subseteq\!\!\!\!\!\raisebox{1pt}{\circ$}}}} \def\cls{\ensuremath{\mathrel{\subseteq\!\!\!\!\!\raisebox{1pt}{$\bullet\$}}}}