LaTeX forum ⇒ Text Formattingmhchem | 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

Postby MatthiasN » Sun Oct 28, 2012 5:17 pm

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:

  1. \usepackage{amsmath}
  2. \usepackage[version=3]{mhchem}
  3.  
  4. \begin{document}
  5. {\it This text is completely in italics except for this \cee{NH4+} formula.}
  6. \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:

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Sun Oct 28, 2012 5:46 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.
  1. \documentclass{scrartcl}
  2. \usepackage[version=3]{mhchem}
  3.  
  4. \begin{document}
  5. \textit{This text is completely in italics except for this \ce{NH4+} formula.}
  6. \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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


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


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 6 guests