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

Possible Duplicate:
\newcommand and spacing

I want to write a command as a shortcut to insert text.

\newcommand{\bl}{$blah blah$}

When I write the command like this, "blah blah" runs into the next word. If I put a space after the second "$", then when I have


I get

blah blah ,

with a space before the comma. What's the proper way of doing this.

share|improve this question

marked as duplicate by Marco Daniel, Gonzalo Medina, cmhughes, Andrey Vihrov, egreg Mar 11 '12 at 20:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Use the xspace package,

\newcommand{\bl}{$blah blah$\xspace}
\bl, \bl this is fine.
share|improve this answer

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