[Tex/LaTex] Command already defined – IOP publication with mhchem

incompatibilitymhchem

I am using iopart class for IOP publication, and I want use the mhchem package for writing chemical equations. I ran into the same problem as here and there, old topics without answer. I compile with pdflatex in Texmaker the following code:

\documentclass[12pt]{iopart}
%Uncomment next line if AMS fonts required
%\usepackage{iopams} 
\usepackage[version=3]{mhchem}

\begin{document}
\title[mytitle]{mytitle}
\author{myauthor}

\begin{abstract}
A minimal non-working iopart + mhchem example
\end{abstract}

\ce{P ->[\sigma_{P}] T}

\end{document}

This throws back the error

! LaTeX Error: Command \equation* already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.2664 }

I added the advice in here:

\makeatletter
\@namedef{ver@amsmath.sty}{}
\makeatother
\usepackage{amstext}

before \usepackage[version=3]{mhchem}. I have no clue what it means.
But it raises plenty of errors :

! Undefined control sequence.
<argument> \rightarrowfill@ 
                            \displaystyle 
l.18 \ce{P ->[\sigma_{P}] T}

? 
! Missing $ inserted.
<inserted text> 
                $
l.18 \ce{P ->[\sigma_{P}] T}

? 
! Extra }, or forgotten $.
\@begin@tempboxa ...begingroup #2\color@endgroup }
                                                  \def \width {\wd \@tempbox...
l.18 \ce{P ->[\sigma_{P}] T}

? 
! Missing $ inserted.
<inserted text> 
                $
l.18 \ce{P ->[\sigma_{P}] T}

? 
! Missing } inserted.
<inserted text> 
                }
l.18 \ce{P ->[\sigma_{P}] T}

EDIT: Following comments below I tried :

\documentclass[12pt]{iopart}
%Uncomment next line if AMS fonts required
%\usepackage{iopams} 

\makeatletter
\@namedef{ver@amsmath.sty}{}
\makeatother
\usepackage{amstext}
\usepackage{chemformula}

\begin{document}
\title[mytitle]{mytitle}
\author{myauthor}

\begin{abstract}
A minimal working iopart + chemformula example
\end{abstract}

\ch{P ->[$\sigma$] T} \par

\end{document}

And it does the job !

Best Answer

Form the file ioplatexguidelines.pdf:

enter image description here

Since mhchem loads and, more importantly, requires amsmath, you have two options: stick to iopart.cls and don't use mhchem but another package offering a similar functionality, or change your document class and use mhchem; as the guideline mentions this is not a problem since they will accept your document written using any other document class.