The xspace documentation says that the way to handle this is with {} right after the macro is called:
\k{}\k
Recent versions of xspace also allow you to specify additional macros that should not generate space after your macro:
\xspaceaddexceptions{\k}
I wanted to use this for \ xspaceaddexceptions {\ textsuperscript}, but this did not work for me, since my store has xspace v1.06 and this is not very recent. Therefore, I used:
\newcommand{\unix}{\textsc{unix}\xspace} \unix{}\textsuperscript{\textregistered}
Which works great, except for the bold section headings, as the font I use does not have bright little caps. Sigh...
source share