Add spaces between numbers in set [closed]

I hope this question isn't too far outside the scope of the site. I'm using the equation editor in Apple's Pages and it specifically calls for LaTeX code. I'm trying to add spaces between the numbers in the set so it looks like {1, 2, 3} rather than {1,2,3}. Any ideas on what I could add to make that happen?

[

• If you can modify the LaTeX code, you can add a thin space after the commas: A=\{a,\,2,\,4,\,7,\,3\}. – Bernard May 19 '17 at 0:02
• The problem is in the final renderer, because TeX does add spaces after the commas, see this picture. Most probably the interface uses something like MathJax, rather than TeX, and then is not able to apply the correct spacing. – egreg May 19 '17 at 17:16

Another option, possibly simpler and takes up less space, is to just insert a ~ where you'd like the space. The ~ (or tilde) puts a small space in-between characters. Using the tilde is not the same in text mode and math mode (see this for more info), but it should be sufficient for what you are trying to do here. So, your set would look like this:

A=\{a,~2,~4,~7,~3\}, \ 3 \in A, \ 6 \notin A

I hope that helps.

LaTex gives you a few options for spacing, all based on \quad, were \quad is a space equal to the current font size (= 18 mu)

\,  3/18 of \quad (= 3 mu)
\:  4/18 of \quad (= 4 mu)
\;  5/18 of \quad (= 5 mu)
\!  -3/18 of \quad (= -3 mu)
\ (space after backslash!)  equivalent of space in normal text
\qquad  twice of \quad (= 36 mu)

Another solution, and one I prefer is to use \hspace{0.1cm} or some variant of this. This take up a little more room but I think it is easier to update as needed.