Math & Sciencemhchem package

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
danj
Posts: 5
Joined: Wed Sep 10, 2008 12:13 pm

mhchem package

Post by danj »

Hi All,

A little help with the above package would be great.

I am writing a paper using the achemso style file from the ACS.

In the past I have used chemsym for formulas, but the ACS prefer mhchem. I am having trouble trying typset 1H or 13C, where both the 1 and 13 are superscript.

I have tried \ce{^{1}H}, \ce{^1H} amongst other things, even the example (\ce{^{227}_{90}Th+}) in the mhchem documentation doesn't run giving an error message of

Argument of ^ has an extra }.
<inserted text>
\par
1.31 \ce{^{227}_{90}Th+}

Runaway argument?
! PAragraph ended before ^ was complete.
<To be read again>.

log file attached.

mwe

Code: Select all

\documentclass[journal=joceah,manuscript=article]{achemso}
\setkeys{acs}{usetitle = true}
\usepackage{caption}
\usepackage{cleveref}
\usepackage{float}
\usepackage{geometry}
\usepackage{natbib}
\usepackage{setspace}
\usepackage{xkeyval}
\usepackage{chemsym}
\usepackage[version=3]{mhchem}
\usepackage{sistyle}
\usepackage[]{nomencl}
\usepackage{hyperref}
\usepackage{epsfig}
\SectionNumbersOn
\SectionsOn
\AbstractOn
\title[\texttt{achemso} a title]
{A title}

\author{an author}
\email{email@hotmail.com}
\phone{5454}
\affiliation[A university]{university of}


\begin{document}

\ce{^{1}H} or \ce{^{13}C}

\end{document}

Thanks in advance
djt
Attachments
forum.log
(48.27 KiB) Downloaded 307 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

danj
Posts: 5
Joined: Wed Sep 10, 2008 12:13 pm

mhchem package

Post by danj »

Got it working, not sure if is the most elegant way, or if it is the way the author/developer intended, but it works.

Code: Select all

\ce{$^{1}$H}
\ce{$^{13}$C}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

mhchem package

Post by localghost »

I can't comprehend the problem because the code below compiles flawlessly. But also with the example you provided I only get some font warnings (after commenting the rather old chemsym package).

Code: Select all

\listfiles
\documentclass[journal=joceah,manuscript=article]{achemso}
\setkeys{acs}{usetitle = true}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[version=3]{mhchem}
\usepackage{siunitx}
\usepackage{hyperref}

\SectionNumbersOn
\SectionsOn
\AbstractOn

\title[\texttt{achemso} a title]{A title}
\author{an author}
\email{email@hotmail.com}
\phone{5454}
\affiliation[A university]{university of}

\begin{document}
  \ce{^{227}_{90}Th+}
\end{document}
Perhaps a matter of outdated packages. With the \listfiles command I obtain the file list shown below (on my Linux system).

Code: Select all

 *File List*
 achemso.cls    2009/09/01 v3.3a Submission to ACS journals
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size12.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
mciteplus.sty    2008/09/30 v1.1 enhanced mcite
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
geometry.sty    2010/02/12 v5.0 Page Geometry
   ifpdf.sty    2009/04/10 v2.0 Provides the ifpdf switch (HO)
  ifvtex.sty    2008/11/04 v1.4 Switches for detecting VTeX and its modes (HO)
geometry.cfg
  helvet.sty    2005/04/12 PSNFSS-v9.2a (WaS) 
 caption.sty    2009/10/09 v3.1k Customizing captions (AR)
caption3.sty    2009/10/09 v3.1k caption3 kernel (AR)
 courier.sty    2005/04/12 PSNFSS-v9.2a (WaS) 
   float.sty    2001/11/08 v1.3d Float enhancements (AL)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2009/08/28 v1.8 graphics configuration of TeX Live
  pdftex.def    2009/08/25 v0.04m Graphics/color for pdfTeX
mathptmx.sty    2005/04/12 PSNFSS-v9.2a Times w/ Math, improved (SPQR, WaS) 
setspace.sty    2000/12/01 6.7 Contributed and Supported LaTeX2e package
     url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.
varioref.sty    2009/09/13 v1.4w package for extended references (FMi)
  joceah.cfg    2009/09/01 v3.3a achemso configuration: J. Org. Chem.
  natbib.sty    2009/07/16 8.31 (PWD, AO)
 natmove.sty    2009/04/20 v1.1 Automatic citation moving with natbib
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
inputenc.sty    2008/03/30 v1.1d Input encoding file
    utf8.def    2008/04/05 v1.1m UTF-8 support for inputenc
   t1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  ot1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  omsenc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  mhchem.sty    2007/05/19 v3.07 for typesetting chemical formulae
  ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
    calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
  twoopt.sty    2008/08/11 v1.5 Definitions with two optional arguments (HO)
 amsmath.sty    2000/07/18 v2.13 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
 siunitx.sty    2009/09/21 v1.3a A comprehensive (SI) units package
   array.sty    2008/09/09 v2.4c Tabular extension package (FMi)
  xspace.sty    2006/05/08 v1.12 Space after command names (DPC,MH)
  ts1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
si-prefix.cfg    2009/09/21 v1.3a siunitx: SI Multiple prefixes
si-named.cfg    2009/09/21 v1.3a siunitx: SI Named units
 si-addn.cfg    2009/09/21 v1.3a siunitx: SI Additional units
si-prefixed.cfg    2009/09/21 v1.3a siunitx: SI Prefixed units
si-accepted.cfg    2009/09/21 v1.3a siunitx: SI Accepted units
si-physical.cfg    2009/09/21 v1.3a siunitx: SI Physically-measured units
 si-abbr.cfg    2009/09/21 v1.3a siunitx: Abbreviated units
hyperref.sty    2009/10/09 v6.79a Hypertext links for LaTeX
 ifxetex.sty    2009/01/23 v0.5 Provides ifxetex conditional
 hycolor.sty    2009/10/02 v1.5 Code for color options of hyperref/bookmark (HO
)
xcolor-patch.sty    2009/10/02 xcolor patch
  pd1enc.def    2009/10/09 v6.79a Hyperref: PDFDocEncoding definition (HO)
etexcmds.sty    2007/12/12 v1.2 Prefix for e-TeX command names (HO)
infwarerr.sty    2007/09/09 v1.2 Providing info/warning/message (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
kvoptions.sty    2009/08/13 v3.4 Keyval support for LaTeX options (HO)
kvsetkeys.sty    2009/07/30 v1.5 Key value parser with default handler support 
(HO)
  bitset.sty    2007/09/28 v1.0 Data type bit set (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)
bigintcalc.sty    2007/11/11 v1.1 Expandable big integer calculations (HO)
pdftexcmds.sty    2009/09/23 v0.6 LuaTeX support for pdfTeX utility functions (
HO)
ifluatex.sty    2009/04/17 v1.2 Provides the ifluatex switch (HO)
 ltxcmds.sty    2009/08/05 v1.0 Some LaTeX kernel commands for general use (HO)

atbegshi.sty    2008/07/31 v1.9 At begin shipout hook (HO)
 hpdftex.def    2009/10/09 v6.79a Hyperref driver for pdfTeX
  ts1cmr.fd    1999/05/25 v2.5h Standard LaTeX font definitions
   t1ptm.fd    2001/06/04 font definitions for T1/ptm.
supp-pdf.mkii
 nameref.sty    2007/05/29 v2.31 Cross-referencing by name of section
refcount.sty    2008/08/11 v3.1 Data extraction from references (HO)
mhchem-prblm.out
mhchem-prblm.out
   t1phv.fd    2001/06/04 scalable font definitions for T1/phv.
ot1ztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OT1/ztmcm.
omlztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OML/ztmcm.
omsztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMS/ztmcm.
omxztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMX/ztmcm.
  ot1ptm.fd    2001/06/04 font definitions for OT1/ptm.
 ***********
I think you should not load so much packages because as you can see, the achemso class does that on its own. Check those dependencies in the class manual.


Best regards and welcome to the board
Thorsten
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

mhchem package

Post by josephwright »

As localghost says, you should keep down extra packages loaded with achemso. Those that the class loads will work when you submit to the ACS: I've had lots of correspondence with them to make sure of this. I'd also suggest avoiding making changes to the settings unless you really need to alter things like sections, abstracts, etc. The journal files (hopefully) have the correct settings for each journal.

On the mhchem issue, I notice that chemsym is not in my TeX Live set up, so is almost certainly not on the ACS system. I wonder if the problem you saw was due to loading both mhchem and chemsym. For me, the following is fine:

Code: Select all

\documentclass[journal=joceah,manuscript=article]{achemso}
\usepackage[version=3]{mhchem}
\title{A title}
\author{an author}
\email{email@hotmail.com}
\phone{5454}
\affiliation[A university]{university of}
\begin{document}
\ce{^1H} or \ce{^{13}C}
\end{document}
Joseph Wright
danj
Posts: 5
Joined: Wed Sep 10, 2008 12:13 pm

Re: mhchem package

Post by danj »

Thanks for your replies. I have a lot of data which will need re-editing (and relies on the chemsym package) before I submit the paper.

I will try your suggestions once I have re-edited the data using the mhchem package.

Regards,
djt
Post Reply