mhchem formatting interrupted

\documentclass[12pt,a4paper]{article}
\usepackage[version=3]{mhchem}

\begin{document}
\ce{K_a \times K_b = K_w}
\end{document}


In \ce{} all text is supposed to be regularized. See how the K_a is regularized but then the K_b is italicised and the ensuing K_w is again subject to \ce's regularization. Why does this interruption in formatting happen? I mean, it probably has to do with the \times, but then why does italicised formatting resume after that?

-
Equilibrium constants are not chemical symbols but normal mathematical variables. The should simply be typeset as such, i.e., in math mode and in italics $K_a \times K_b = K_w$. For reference see page 58 of IUPAC Green Book (third edition). –  clemens May 24 '13 at 20:27

Not sure why it happened, but you can fix it by placing the \times around in a $..$.

\documentclass[12pt,a4paper]{article}
\usepackage[version=3]{mhchem}

\begin{document}
\ce{K_a \times K_b = K_w}

\ce{K_a ${}\times{}$ K_b = K_w}
\end{document}


To keep the proper math spacing I added {} to make the times a binary operator. Alternatively you could use \ce{K_a \mathbin{\times} K_b = K_w}, but I prefer the {}.

-
It's documented (See page 8 of the documentation). –  Gonzalo Medina Oct 1 '11 at 0:17
Um, about the {} to make the times a binary operator, I'm not sure I understand. Can you please explain? –  ptrcao Oct 1 '11 at 0:30
Binary operator in the math sense. Best to have a look at the difference spacing between the times symbols in $A \times B$ and $\times B$. Or, try taking out the {} in the solution and see what happens. If this still is not clear, perhaps you should post a question. –  Peter Grill Oct 1 '11 at 0:52

You could simply enclose \times in braces:

\documentclass[12pt,a4paper]{article}
\usepackage[version=3]{mhchem}
\begin{document}
\ce{K_a {\times} K_b = K_w}
\end{document}


-