News for hackers. Stuff that matters.
Re:Essential LaTeX packages by CJefferson on Wednesday June 11, 2014 @01:44PM (#7879304)
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:

    Bobis Bob.
While: Given: \newcommand{\S}{Bob } expands to

    Bob is Bob .
One can write: \newcommand{\prog}{\textsc{prog}\xspace}. Then we get:

    Bob is Bob.
Re:Essential LaTeX packages by symmetricsaurus on Wednesday June 11, 2014 @02:27PM (#7879572)
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.
Re:Essential LaTeX packages by dfc on Wednesday June 11, 2014 @03:11PM (#7879851)
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.
Re:Essential LaTeX packages by CJefferson on Wednesday June 11, 2014 @05:05PM (#7880439)
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!
Re:Essential LaTeX packages by doomrobo on Wednesday June 11, 2014 @04:44PM (#7880329)
I've been having this problem for months now and I never figured out a way around it. Thank you so much for this!