## LaTeX forum ⇒ Text Formatting ⇒ mhchem | Italicized Chemical Formula Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

### mhchem | Italicized Chemical Formula

Hi everyone,

I am using italic font in a certain paragraph of my document, but it won't put the chemical formulas I use in italics. My problem looks a bit like this:

\usepackage{amsmath}\usepackage[version=3]{mhchem} \begin{document}{\it This text is completely in italics except for this \cee{NH4+} formula.}\end{document}

I read the mhchem package information, but there is nothing on italics or bold font use. There is a way to change the font used, but this is not what I'm looking for. I know that I can put the formula in bold font by putting it in math mode and using \mathbf or \boldsymbol. So is there an analogue command for italics?

Thanks for reading and hopefully somebody can help me.
Matthias

Tags:

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
With \cee you are using the wrong command. It is made for chemical equations inside math environments. If you use \ce as suggested by the mhchem manual, there is no problem.
\documentclass{scrartcl}\usepackage[version=3]{mhchem} \begin{document}   \textit{This text is completely in italics except for this \ce{NH4+} formula.}\end{document}

By the way, you better use \textit instead of the old LaTeX2.09 syntax \it to limit the scope of the (correct) \itshape declaration (see above).
MatthiasN wrote:[…] I know that I can put the formula in bold font by putting it in math mode and using \mathbf or \boldsymbol. […]

The font of the chemical symbols and formulas is usually customized by the provided \mhchemoptions command as explained in the section "Fine Tuning" of the package manual.

Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1