I'm writing my dissertation and that involves typing a lot of $\mathrm{CO_2}$. I'd like to make a macro for it that's a lot easier to type, but if I put \newcommand{\co2}{\mathrm{CO_2}}, for example, it gives me the error that \mathrm can only be used in math mode. But using \newcommand{\co2}{$\mathrm{CO_2}$} doesn't work either.
Is there a way for me to make a macro that makes typing CO_2 easier, even if it doesn't use \mathrm?






\def\co2{CO$_2$} The level of \co2 in London is ....– Fran Apr 08 '19 at 09:15