TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes, one doesn't want whitespace between tokens of a math expression, and how can one remove the whitespace? For example, $ foo-bar $ displays as foo - bar, but foo-bar is prefered.

share|improve this question
In this short example, the answer is straight-forward: - is interpreted as a binary operator, which has space around it. If you want to avoid such space, use {-}. But if you're using text in this way, why not just write foo-bar outside math mode? – Werner Oct 18 '13 at 18:03
@Werner: or \mathord{-} – Francis Oct 18 '13 at 18:09
Is your foo-bar the name of a variable? – egreg Oct 18 '13 at 20:52
up vote 3 down vote accepted
$a-b$ and $a{-}b$ and $a\!-\!b$ and $a\!\!-\!\!b$

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.