I am using the \usepackage[version=3]{mhchem} package, and would like to write the formula for Dolomite in my report: (Ca,Mg)CO3

So far I haven't found a way to get that comma right in my formula using the mhchem package, and haven't found anyone having had troubles doing that so far. Anyone could help me doing so?


  • 2
    Dolomite is CaMg(CO3)2. What you write, (Ca,Mg)CO3 is Mg-rich calcite that is a different mineral to dolomite and has different crystal structure and properties. – Gimelist Aug 18 '19 at 5:22

The OP's formula (Ca,Mg)CO3 is completely fine and meets IUPAC recommendations [1, p. 21], section IR-

(d) In solid-state chemistry, to enclose symbols of atoms occupying the same type of site in a random fashion. The symbols themselves are separated by a comma, with no space.


  1. K(Br,Cl)

To achieve this with mhchem, the sane way would be to use braces around the comma (as mentioned in the comments): {,}. Note that chemformula doesn't require the comma to be escaped and renders the formula correctly "as is":


        modules = all


\ce{(Ca{,}Mg)CO3} (\texttt{mhchem})

\ch{(Ca,Mg)CO3} (\texttt{chemformula})



  1. IUPAC “Red Book” Nomenclature of Inorganic Chemistry, 1st ed.; Connelly, N. G., Damhus, T., Hartshorn, R. M., Hutton, A. T., Eds.; IUPAC Recommendations; Royal Society of Chemistry: Cambridge, UK, 2005. ISBN 978-0-85404-438-2. PDF
  • 1
    Thank you very much ! so easy, and yet haven't found any answer anywhere. Thanks again :) – TheEpok Jan 30 '19 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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