# How to properly typeset the set of all equivalence classes

Consider the following MWE:

\documentclass{amsart}

\begin{document}
$$X/\sim$$
\end{document}


which produces

Not very appealing to the eye. Is there a way to reduce the space between \sim and /. Furthermore, what would be the correct way of typesetting this and in general which symbol should be used for typesetting an equivalence relation?

• \sim is a binary relation and as such has additional spacing before and after the symbol – user31729 Jan 27 '17 at 17:08
• X/{\sim}; there should already be something like this on the site. – egreg Jan 27 '17 at 17:09
• @egreg Thanks. Did not found something at first sight. Maybe I was looking for something too math involved. – TheGeekGreek Jan 27 '17 at 17:10
• i think this could count as a duplicate: Is there a way to make a symbol behave as either mathord or mathrel depending on context?. (granted the title isn't promising.) – barbara beeton Jan 27 '17 at 18:31

I suggest to use logical markup for such typesetting if this is needed a lot of times, say, using a command \equivclass

It is possible to introduce some negative spacing with \!, but this will lead to very narrow spacing between the / and ~ symbols. I don't recommend it. Judge yourself, however.

\documentclass{amsart}

\newcommand{\equivclass}[1]{%
#1/{\sim}%
}
\newcommand{\equivcls}[1]{%
#1/\!{\sim}%
}

\begin{document}

$$\equivclass{X}$$

$$\equivcls{X}$$

\end{document}