Text FormattingSpace after command

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

Space after command

Post by Laurentius »

Code: Select all

\def\a{a}
\a b
results in "ab"; can I make an \a such that

Code: Select all

\a b
results in "a b"?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Space after command

Post by Stefan Kottwitz »

You could define

Code: Select all

\def\a{a\ }
or

Code: Select all

\def\a{a\space}
or, if you don't want the space before punctuation

Code: Select all

\usepackage{xspace}
\def\a{a\xspace}
Stefan
LaTeX.org admin
Post Reply