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

Good day,

My minimum working example:





The result is:

Result of MWE

Now I don't like the spacing for the term: "n!d!". I'd prefer a bit more space between 'n' and '!' and between 'd' and '!'.

Any ideas?

share|improve this question
A short solution would be forcing a single space between them by using \ , like this: {n\ ! d\ !} – Luan Resende Jun 24 '13 at 12:27
That would be incorrect. In case the ! is followed by an ordinary symbol, add a thin space: n!\,d!, but don't detach the ! from the symbol preceding it. – egreg Jun 24 '13 at 12:32
up vote 19 down vote accepted

It's incorrect to detach the ! meaning “factorial” from the symbol preceding it, because it's a modifier similar to a prime or a subscript and is not a punctuation symbol.

In case you have a factorial followed by an ordinary symbol (not a relation or operation symbol), it's good practice to add a thin space after it:




I've also shown what would happen when detaching the factorial symbol, in order to demonstrate it would be wrong.

enter image description here

share|improve this answer
I'm not familiar with TeX's ifttt syntax but wouldn't it be possible and useful to create a macro for this, say factorial, which checks automatically what follows after it and adds a thin space if appropriate? – Casimir Nov 24 '14 at 13:41
@PacificOrion The main problem is deciding when a space is appropriate and this is the main reason why it's declared as ordinary rather than punctuation. Having a space or not depends on several considerations. – egreg Nov 24 '14 at 14:10
What would those be? Wouldn't adding a thin space whenever \factorial was followed by something other than } be a good start? – Casimir Nov 24 '14 at 14:37
@PacificOrion When \frac{n!}{2} is processed, ! won't be followed by } any more. – egreg Nov 24 '14 at 14:43
Ah? I guess I don't know enough about TeX's parsing. Could \factorial check the user's input rather than the processed stuff? – Casimir Nov 24 '14 at 14:48

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.