I have been using \usepackage{mhchem} to write chemical equations. Now I want to use also \usepackage{chemformula}. But when I use the second package it appears that LaTeX doesn't understand the keywords of the first package.

Is it possible? Any idea about how to fix it?

  • 4
    The two are similar but not identical, as detailed below: 'pick one'! – Joseph Wright Aug 24 '17 at 7:42
  • 6
    Like I said, similar but not identical: chemformula assumes text mode and is arguably more focussed. In your example \Delta G isn't a chemistry formula so shouldn't be in either of the forms: just $\Delta G$ would be appropriate. – Joseph Wright Aug 24 '17 at 7:59
  • @JosephWright $\Delta G$ as you wrote, is italic. I have read the packages and mhchem seems to be prepared for writing Deltas and so on, why do you say it is not? – santimirandarp Aug 24 '17 at 8:02
  • 4
    Yes: it's a variable (Gibbs energy): see for example Physical Chemistry by Atkins which is typeset carefully and has this form. – Joseph Wright Aug 24 '17 at 8:04

I am not a user of either of the mentioned packages, mhchem and chemformula.

From the documentation of chemformula:

Probably every chemist using LaTeX2ε is aware of the great mhchem package by Martin Hensel. There have always been some difficulties intertwining it with the chemmacros package, though. Also, some other minor points in mhchem always bothered me, but they hardly seemed enough for a new package. They weren’t even enough for a feature request to the mhchem author. The challenge and the fun of creating a new package and the wish for a highly customizable alternative led to chemformula after all. chemformula works very similar to mhchem but is more strict as to how compounds, stoichiometric factors and arrows are input. In the same time chemformula offers many possibilities to customize the output.

Though not mentioned explicitly, I have a feeling that these two package are not compatible. But your purposes should be served by either of the packages.

chemmacros is a comprehensive support for typesetting chemistry documents.

Either mhchem or chemformula can be loaded as modules:

formula = chemformula|mhchem

Default: chemformula.

If you set formula = {chemformula}, the chemformula module makes it possible that you can set all chemformula options via the \chemsetup command using the module chemformula, for example:


And if you set formula = {mhchem}, the chemformula module makes it possible that you can set all of mhchem’s options via the \chemsetup command using the module mhchem, for example:


(The last examples also implicitly indicate that either mhchem or chemformula should be used in a document, but not both.)

  • @santimirandarp Please see my edit at the end of my answer. And you are most welcome. – Masroor Aug 24 '17 at 6:55
  • @santimirandarp Yes, of course, isn't that expected? You will have to adapt to a style and stick to it. Again, my knowledge on these packages is limited, I don't (don't need to) use either. – Masroor Aug 24 '17 at 7:59
  • 3
    It should not be a problem to use both packages in one document. However, for conistent typeset formulas and reactions I wouldn't use both. They use different spacing, different arrows, ... – clemens Aug 24 '17 at 8:11
  • @clemens great, would you recommend one? – santimirandarp Aug 24 '17 at 8:59
  • 2
    @clemens ohh..haha. This place is wonderful. Well that the one I chose finally..I hope it works good! – santimirandarp Aug 24 '17 at 10:21

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.