The complexity
package is a very useful one for a Computer Scientist. Recently, I've discovered the xspace
package, which provides the \xspace
macro that helps defining macros that do not need the \
escape to avoid globbing a subsequent whitespace:
\newcommand{\myname}{Nicola\xspace}
...
\myname is walking on the street % No need to write \myname\ or \myname{}
Now, I use a lot of commands from the complexity package, which defines tens of commands that are commonly used inside text so that the need of escaping is very frequent. I would like to have them use \xspace
by default, but redefining, say, \ComplexityFont
does not work, because apparently \xspace
must be put exactly at the end of the macro being invoked (not a macro expanded from it). The package defines all its macros with simple \newcommand
s, so I don't think there is a way to hook into it.
Is this redefinition possible to automate in some way, or should I suggest this feature to the package author directly?
\xspace
cause problems in math mode? If not, it could still be a nice thing to do. – gigabytes Feb 18 '16 at 9:37\xspace
. ;-) – egreg Feb 18 '16 at 9:38$\protect\NP$
whenever\NP
appears in a section title. – egreg Feb 18 '16 at 9:44\xspace
– egreg Feb 18 '16 at 9:54