Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

add comment

1 Answer 1

Use the xspace package,

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

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