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

\bl,

I get

blah blah ,

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

share|improve this question
add comment

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.

1 Answer

Use the xspace package,

\documentclass{article}
\usepackage{xspace}
\newcommand{\bl}{$blah blah$\xspace}
\begin{document}
\bl, \bl this is fine.
\end{document}
share|improve this answer
add comment

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