26

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.)

Caramdir
  • 89,023
  • 26
  • 255
  • 291
Peutch
  • 2,182

2 Answers2

27

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.

Mensch
  • 65,388
Dorji
  • 279
  • 3
    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 ... – Mensch Mar 26 '13 at 03:00
13

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$  

equation of a straight line in x-y space with intercept b and slope c

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.

Mico
  • 506,678
  • 3
    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 09:42
  • 3
    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
  • 7
    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 03:17
  • TeX math spacing has always needed a few fixes anyways (\,, {}, ...). 5. TeX was designed by one person, and statements unconditionally praising an early set of decisions raise suspicion ("finely balanced system of setting spaces", "the choices involved have proven their desirability over decades"). 6. The last paragraph (excessive praise with vague dissing of the alternatives) is 100% superfluous and off-putting to a learner.
  • – Lover of Structure Mar 26 '13 at 03:23
  • @LoverofStructure - Just to make sure I understand the point of your comments: Are you demanding that I delete -- or at least completely revise -- the final paragraph of my answer? Or is it something else? Please advise. – Mico Mar 26 '13 at 07:31
  • @Mico (La)TeX can do a great many things, and for a lot of things (mostly those with a programming aspect to them) it's the only accessible solution. But I think you're praising the defaults more than someone asking this question might want to hear (after all the OP has proven to have some eye for typography by asking this question). There's plenty of areas of improvement for LaTeX, and the existence of the LaTeX3 project acknowledges this and deals with this. And just think about all the horizontal/vertical spacing questions on TeX.SE. I might have phrased your answer like: ... – Lover of Structure Mar 27 '13 at 01:13
  • 2
    ... "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 01:15
  • 1
    ... 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 01:16