Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

An argument error is thrown when I attempt to use thermodynamic states (as well as custom state variables via \DeclareChemState) in chemmacros's reactions environment.

The MWE provided at the end of the question will reproduce the following error upon (at the time of this question) typesetting with the most updated version of TeX Live 2012.

The error:

[...] Argument of \chemformula_superscript:n has an extra }.
<inserted text>
                \par
l.8 \end{reactions}

The MWE:

\documentclass[12pt]{article}
\usepackage{chemmacros}
\DeclareChemState[delta=false]{StdElPot}{E}{\volt}
\begin{document}
\begin{reactions}
Pd\pch[2]\aq{} + 2 \el{} &<=> Pd\sld{} &&\StdElPot{0.83} \\
PdCl4\mch[2]\aq{} + 2 \el{} &<=> Pd\sld{} + 4 Cl\mch\aq{} &&\StdElPot{0.64}
\end{reactions}
\end{document}
share|improve this question

1 Answer

up vote 2 down vote accepted

I seem to have missed this one...

You haven't escaped \StdElPot and so chemmacros assumes the numbers in its argument are subscripts to atoms. Escaping is easy: put the part that has to be escaped between "", see section 25.3. Commands and section 27. Escaped Input of the manual for details.

BTW: the usage of \pch and \mch is not recommended in the reaction and reactions environments nor in \ch. The manual clearly states this:

enter image description here

The preferred syntax thus would look as follows:

\documentclass[12pt]{article}
\usepackage{chemmacros}
\DeclareChemState[delta=false]{StdElPot}{E}{\volt}
\begin{document}
\begin{reactions}
 Pd^2+ \aq{}    + 2 e- &<=> Pd\sld{}               && "\StdElPot{0.83}" \\
 PdCl4^2- \aq{} + 2 e- &<=> Pd\sld{} + 4 Cl- \aq{} && "\StdElPot{0.64}"
\end{reactions}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.