I am using the package mhchem in order to typeset chemical formulas and equations. If I directly insert a state of aggregation into an mhchem \ce command, it appears as upright. If I insert it via a macro, it becomes italicized. I don't have any aesthetic objections to either, but why does this behavior occur?
The only thing I could think of that would cause this is that the macro is being automatically put into math mode, but I don't understand why this would occur, since newcommand does not ordinarily automatically set text in math mode. Otherwise, it must be some part of the parsing behavior.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[version=4]{mhchem}
% States of aggregation
\newcommand{\liq}{(l)}
\newcommand{\aq}{(aq)}
\begin{document}
\noindent
\ce{H2O(l) <=> H+(aq) + OH^-(aq)}\\
\ce{H2O\liq{} <=> H+\aq{} + OH^-\aq{}}
\end{document}

mhchem 2015/04/07 v4.00. No italics. – egreg Apr 10 '15 at 17:47\listfilesat the top of the example and show the result you get in the.logfile after** File List **? – egreg Apr 11 '15 at 13:37.logfile and it sawsmhchem.sty 2015/03/13 v3.21 for typesetting chemical formulae. My mistake; I am using ShareLatex, an online version of LaTeX, and did not consider the possibility that the package had not been updated yet. However, this does not really answer the question as to why mhchem is performing this italicizing, so I am hesitant to post this as an answer. Should I answer the question myself? – Bob Apr 11 '15 at 21:35