I'm writing a document containg NOx a lot. It appears in section titles, regular text and tables, in sans serif, roman, bold and medium. Therefore I defined a command:
\newcommand \nox {NO\textsubscript{x}\xspace}
To use this with hyperref I redefined in to:
\newcommand \nox {\texorpdfstring{NO\textsubscript{x}}\xspace}
The problem I now encounter is that the \xspace command no longer works and all spaces between NOx and the next word disappeared. I can manually include the space by adding a ~-symbol, but that makes spaces appear everywhere, which is also unwanted. How should I redefine \nox to achieve correct spacing and work together with hyperref.
\newcommand{\nox}{\texorpdfstring{NO\textsubscript{x}}{NOx}\xspace}
help? For chemical typesetting you might want to have look atmhchem
. – moewe Sep 6 '13 at 14:30\texorpdfstring
; add{}
or, better{NOx}
, in front of\xspace
. – egreg Sep 6 '13 at 14:33