3

is there currently a problem with the chemmacros package? I've just come back to my thesis to make corrections but I'm getting this new random error when I hadn't seemingly changed anything since the last time I processed the document. I've fully updated MikTex console but I always get this error when I use chemmacros:

! Undefined control sequence.
l.669 \chemmacros_load_module:n
{nomenclature}

This error occurs no matter which chapter I build and it always adds one page at the beginning of the document with only the word nomenclature.

In my document preamble I have:

\usepackage{chemmacros}
\chemsetup{modules={all}}
cgnieder
  • 66,645
Will Vickery
  • 121
  • 1
  • Can you please add a minimal example of code that shows the issue? – egreg Mar 30 '22 at 14:01
  • Do you also load ghsystem? Then this is https://github.com/cgnieder/ghsystem/issues/13 and can be resolved by defining \chemmacros_load_module:n to do nothing but gobble its argument. – cgnieder Mar 30 '22 at 14:04
  • Thank you, this github.com/cgnieder/ghsystem/issues/13 solved it! – Will Vickery Mar 30 '22 at 14:48

1 Answers1

4

The error most likely does come from ghsystem and can be reproduced by:

\documentclass{article}
\usepackage{ghsystem}
\begin{document}
\end{document}

The problem is that the package is not adapted to v6 of chemmacros, yet. Until it is the error can be resolved by defining \chemmacros_load_module:n to simply gobble its argument:

\documentclass{article}
\ExplSyntaxOn
\cs_new:Npn \chemmacros_load_module:n #1 {}
\ExplSyntaxOff
\usepackage{ghsystem}
\begin{document}
\end{document}

Unrelated, but since you mention having

\usepackage{chemmacros}
\chemsetup{modules={all}}

in your preamble: this should raise the following warning in your log:

Package chemmacros Warning: The module mechanism has changed with v6!
(chemmacros)                =========================================
(chemmacros)                * All modules have been integrated into 
(chemmacros)                the main package and thus are preloaded 
(chemmacros)                already (unless you have loaded 
(chemmacros)                `chemmacros' with the `minimal' option).
(chemmacros)                * The new default corresponds to the 
(chemmacros)                earlier setting `modules=all'.

This means with an up to date chemmacros (newer than 2022/01/16) you can simply drop loading any modules. \usepackage{chemmacros} should suffice.

cgnieder
  • 66,645