Is there anything wrong with the simple approach of just adding \<space> after the command? For example:
\newcommand{\T}{Mike}
\T\ is \T.
Which will give you:
Mike is Mike.
The problem with hard coding the space is there are times it is not wanted/needed. I am stealing the following from xpsace documentation.
Input with "\newcommand{\gb}{Great Britain\xspace}":
\gb is a very nice place to live.\\
\gb, a small island off the coast of France.\\
\gb\footnote{The small island off the coast of France.}
is a very nice place to live.
Results in the output
Great Britain is a very nice place to live.
Great Britain, a small island o the coast of France.
Great Britain[^1] is a very nice place to live.
There is nothing wrong, except I feel I shouldn't have to remember to make sure I do a \<space> after commands instead of just a space. Why should I have to remember where to put <space> and where to put \<space>, that's what computers are for!
Comments
I would recommend everyone look at xspace.
It only has one tiny aim - to deal with spaces after commands.
Given: \newcommand{\S}{Bob} then \S is \S. expands to:
While: Given: \newcommand{\S}{Bob } expands to One can write: \newcommand{\prog}{\textsc{prog}\xspace}. Then we get:Is there anything wrong with the simple approach of just adding \<space> after the command? For example: \newcommand{\T}{Mike} \T\ is \T. Which will give you: Mike is Mike.
The problem with hard coding the space is there are times it is not wanted/needed. I am stealing the following from xpsace documentation.
Input with "\newcommand{\gb}{Great Britain\xspace}":
Results in the outputThere is nothing wrong, except I feel I shouldn't have to remember to make sure I do a \<space> after commands instead of just a space. Why should I have to remember where to put <space> and where to put \<space>, that's what computers are for!
I've been having this problem for months now and I never figured out a way around it. Thank you so much for this!