# Remove spaces after a custom definition

As scientific species names should be written in italic, I have adopted a shortcut to do this in LaTex by creating a definition in the preamble:

\def\GM{{\it Gadus morhua~}}


Then it's easy to call for \GM is a fish, which returns "Gadus morhua is a fish". Note that I have added ~ to the definition, so that I won't need to write \GM~. This works except, if I want to write The fish is called \GM., which would return "The fish is called Gadus morhua ." (with a space between morhua and period). In order to maximize my lazy writing style I would like to find a way to "eat away" that space I defined earlier. I know that a negative space exists in math mode, but writing $\GM\!$ does not lead to a right result. Is there a way adding a negative space to text mode?

-
Please note that the \it, \bf, etc. font macros are deprecated because they do not use the new font selection scheme introduced with LaTeX2e. Please use {\itshape ..}, {\bfseries ..} or \textit{..}, \textbf{..} instead. See Does it matter if I use \textit or \it, \bfseries or \bf, etc. and Will two-letter font style commands (\bf, \it, …) ever be resurrected in LaTeX? for more information. –  Martin Scharrer May 21 '12 at 11:50

This is exactly what the xspace package is for. The manual says:
Thanks! It seems not to work with \def, though. If I define \def\GM{{\it Gadus morhua\xspace}}, I'll get Gadus morhuais a fish without space –  Mikko May 21 '12 at 10:41
@Largh Don't use \def, first of all, nor the deprecated command \it. Use \newcommand{\GM}{\textit{Gadus morhua}\xspace} instead. –  egreg May 21 '12 at 10:47
Ops, I placed it inside \it{}. That's why it didn't work. Thanks for help! –  Mikko May 21 '12 at 10:49
@Largh: Also \xspace must be the very last thing in the macro definition in order to be able to check for a following space. Having a } or anything after it will make it useless. –  Martin Scharrer May 21 '12 at 11:54