Macros, htlatex with/without “xhtml, mathml”

Following mwe.tex works with htlatex mwe.tex. With htlatex mwe.tex "xhtml, mathml" it gives correct C_5 but \S is like S5, not S_5.

\documentclass{article}

\usepackage{xspace}
\renewcommand*{\S}{\ensuremath{S_5}\xspace}

\begin{document}

Group $C_5$ is subgroup of \S.

\end{document}


Too many things to tweak with htlatex... For example "xhtml, mathml" fixed problem that I asked two days ago.

-
Why don't you leave out the \ensuremath and use \S in math mode? However, it seems that the mathml option isn't able to see the subscript in the macro. –  egreg Jul 4 '13 at 13:19

Sub- and super-scripts are redefined on several places by tex4ht. \S command doesn't work because in the document preamble they have different meaning than in the document text. If you want to activate them, use command line option early_ for subscripts and early^ for superscripts. So in your case, compile the document with:
htlatex filename "xhtml, mathml, early_"