I'm certain I have read that xspace can cause more problems than it solves. But I cannot find anything to that effect either on this site or the web. Are there any drawbacks or risks associated with it?
|
I originally implemented The original version used a very simple nested test for following punctuation, but it could get the test wrong in some (well rather a lot really) of cases. Morten made the tests a lot better so the current version makes the correct choice in more cases and is more easily customised) however making the tests more complicated highlights the problem with this kind of package. The rule in TeX is really quite simple, after a command name that uses letters (as opposed to single character command names using non-letters such as So, if you find it useful, fine, it's there. But personally I wouldn't recommend it. |
|||||
|
\newcommand{\test}{\emph{test}\xspace}and still the problem exists: the italic correction is inserted in situations such as\test,, which is wrong. I never recommend (nor use myself)xspace. :) – egreg Dec 11 '12 at 17:59\newcommand{\newentity}[3][/]{\@ifdefinable{#2}{\def#2#1{#3}}}and then\newentity{\foo}{\emph{foo}}will define\footo require/after it; or\newentity[|]{\bar}{\textbf{bar}}would require\bar|. As usual\makeatletterand\makeatotherare necessary around the definition of\newentity;\newentitywill throw an error if the command is already defined. – egreg Dec 11 '12 at 22:54