# Extra space between number and variable in math mode

I find that if I typeset $3 q$, I find the 3 and the q a bit too close to each other. I know that I can manually add a thin space by typing: $3 \, q$.

1. However, I was wondering if there was a way to automate this, i.e. that every time a number precedes a variable, a thin space is added.

In other words I would like a thin space to be automatically added in $5 q$, but not in $5 7$.

2. And is it possible to have added in $p q$ too? Do you recommend such practice between two variables that are multiplied? (I don't want to use \cdot as it clutters the display.)

-
I recommend neither. Look at good quality math books. –  egreg Sep 19 '11 at 19:12

TeX has a finely balanced system of setting spaces between various types of math "atoms". For example, consider the following simple formula:

$y = b + cx$


Observe that the distance between y and = (and also between = and b) is slightly larger than that between b and +, which again exceeds that between c and x. This is done on purpose, of course, and the choices involved have proven their desirability over decades.

If you were to systematically increase the spacing between any two "atoms" that are multiplied together (such as c and x in the example above), you should also be willing to increase the spacing between all other types of "atoms" in order to preserve the overall balance. To claim that this would be a rather tricky enterprise would be a rather strong understatement.

In short, it's best not only to get used to TeX's way of typesetting mathematics but also to appreciate it for the high standard it sets. TeX's method is the standard against which all other systems for typesetting mathematics are judged and against which they, regrettably, almost invariably fail.

-
Ok thank you for answer! If I agree that it would be technically difficult to do so, I do not on the hand accept that one should NOT do it just on the grounds that this has been the way for thirty years. I have been using TeX for seven years and I do appreciate its general beauty. But nothing in this world is sacred. I do find the c and the x too close to each other to my tastes... but hey, if it's not changeable, it's a moot point. –  Peutch Sep 20 '11 at 9:42
You may want to look into the jamtimes package (jam is short for Journal d'Analyse Mathematique), which uses a specially expanded form of Times New Roman for its fonts. –  Mico Sep 20 '11 at 14:57
This is exactly the answer that I would not be looking for. 1. Very often (and the OP confirms this for his case) I am trying to intentionally deviate from some established style, for good reasons or sometimes for personal reasons. What I don't want is somebody else telling that my preferences shouldn't be implemented. You in fact don't know the OP's context. 2. You're not actually giving any arguments for the default style. The argument by tradition is unlikely to be convincing. 3. Praising LaTeX is best done by showing it can do anything. –  Lover of Structure Mar 26 '13 at 3:17
... "The default does X, and this mathord/'atom'/whatever algorithm is why it's done this way, and it's well-respected within the community and established (and I like the default), so you likely won't go wrong with it. Changing X to Y is easy/possible/hard/impossible for reason Z (something relating to math character classes), but someone might attempt doing V." I find your wording, such as "best to get used to [it]" and "all other systems [...] almost invariably fail", too strong to read for a curious non-enthusiast (whether his thoughts about spacing are justified or not). ... –  Lover of Structure Mar 27 '13 at 1:15
... Also, perhaps the OP is typesetting for a particular educational context or in another locale's tradition where the requested spacing is quite sensible. –  Lover of Structure Mar 27 '13 at 1:16

Just type \ and press space bar between the numbers you want an extra space. for example: $(2,3,4)$ and I need extra space between numbers, then I would type: $(2,\ 3,\ 4)$ or if I need more extra space, then type: $(2,\ \ 3,\ \ 4)$. Hope this helps.

-
Welcome to TeX.sx! A tip: You can use backticks ` to mark your inline code as I did in my edit. –  texenthusiast Mar 26 '13 at 2:33
Please just have a look to @Mico's answer. It is better to use the LaTeX-build-in-typesetting of mathematics than to try to do it by your own ... –  Kurt Mar 26 '13 at 3:00