The output may be different if \nonfrenchspacing is in force and the replacement text of the macro ends with a period (or other punctuation), because \ always inserts a normal (non sentence ending) space.
– egregMay 31 '13 at 12:35
4
yet another possibility is to enter it as ... {\answer} ...; this is "neutral" regarding frenchspacing, and doesn't have the disadvantages of \xspace pointed out by egreg.
– barbara beetonMay 31 '13 at 12:48
@felix-freiberger Yes. On the other hand, the German module for babel issues frenchspacing, so the problem disappears when writing in German.
– egregMay 31 '13 at 13:43
@egreg OK, thank you! Unluckily, I can't accept a comment, so if you'd like to post that as an answer...
– fefreiMay 31 '13 at 13:46
@felix-freiberger Would you be happy with closing this as a duplicate of http://tex.stackexchange.com/q/62028? If not, you should expand your question to make it different from the other one.
– egregMay 31 '13 at 14:06
That question doesn't have an answer giving me a clear "Yes, they are equal, as long as...", just some cases where ~ behaves differently. Apart from that, this really is a duplicate.
– fefreiMay 31 '13 at 14:31
\newcommand{\answer}{\emph{42}\xspace}. see Macros for common abbreviations – barbara beeton May 31 '13 at 12:26\xspacemight have some merits, see http://tex.stackexchange.com/questions/86565/drawbacks-of-xspace – egreg May 31 '13 at 12:30\nonfrenchspacingis in force and the replacement text of the macro ends with a period (or other punctuation), because\always inserts a normal (non sentence ending) space. – egreg May 31 '13 at 12:35... {\answer} ...; this is "neutral" regarding frenchspacing, and doesn't have the disadvantages of\xspacepointed out by egreg. – barbara beeton May 31 '13 at 12:48\answer\ist more convenient to type for me. – fefrei May 31 '13 at 13:31babelissuesfrenchspacing, so the problem disappears when writing in German. – egreg May 31 '13 at 13:43~behaves differently. Apart from that, this really is a duplicate. – fefrei May 31 '13 at 14:31