# Spacing around a comma to separates conditions (in math mode)

Let say I have a set

\{ x \in A : first condition , second condition , third condition \},


or as a more explicit example

\{ x \in A : x > 0 , x^2 \in B , x^3 \notin C \}.


I find that the spacing around the commas are too small, and sometime it makes it hard to identify the different conditions. What would be a good practice to have nice spacing there?

I thought of \ , \. But I really does not like it, since the code is messy afterwards. An other solution I thought of is \mathbin{,} or \mathrel{,}. Does anyone has better suggestion or motivations for choosing one of these solutions over the others.

• The punctuation should really be in text mode not math mode, try \text{ , } (note the spaces around the comma). Spaces are usually ignored in math mode. Jul 21, 2016 at 13:03
• @ArTourter I don't agree with half of your command, because there should not be a space before the comma, see for Example this answer on English.SE. Different rules might apply in other languages. Jul 21, 2016 at 13:11
• If you feel a space is needed ,\  is usually enough. I agree with dadeix86 space in in front of , looks bad Jul 21, 2016 at 13:13
• @ArTourter At the moment, I find your comment the most satisfying answer. If you turn at as an answer I will accept (except if something new comes in, in the meanwhile). Jul 26, 2016 at 16:53

Related to something I wrote recently, I would use ,\  in math mode, and just “text mode” when text is involved. I put “” because by text mode I don't mean \text.

\newcommand*\mathwords{\textnormal}
$\{ x \in A : \mathwords{first condition, second condition, third condition} \}$
$\{ x \in A : x > 0 ,\ x^2 \in B ,\ x^3 \notin C \}$


Something should be done so that TeX would break between lines and hyphenate the words in \mathwords, ideally. But here it's just an example.

You could do exactly what you described using \ , \ , but with a new command in order to make things clearer:

\newcommand{\setsep}{ \ , \ }

\begin{document}
\{ x \in A : x > 0 \setsep x^2 \in B \setsep x^3 \notin C \}.
\end{document}


Result:

You can also use \textbf{} to make the comma even more apparent:

\newcommand{\setsep}{ \ \textbf{,} \ }

\begin{document}
\{ x \in A : x > 0 \setsep x^2 \in B \setsep x^3 \notin C \}.
\end{document}


Result: