When loading the diffcoeff package, even in very basic examples, I'm getting a repeated error that wasn't there a few weeks ago. Does anyone know what the problem is? Thanks!

Here is the MWE:

\diffdef {}
    op-symbol    = \mathrm{d},
    op-order-sep = 0 mu

Some text.


And here is the error:

Illegal parameter number in definition of \key code > 
<to be read again> 
l.138   } 
  • 1
    I'm working on it
    – Joseph Wright
    Jun 7, 2022 at 14:21
  • I am discussing with the LaTeX team: the issue arises due to a package change, but that was deliberate and potentially highlights an issue.
    – Joseph Wright
    Jun 7, 2022 at 14:34

2 Answers 2


I couldn't reproduce the error until an xtemplate update this morning. I've amended diffcoeff following a suggestion from Joseph Wright and uploaded the revised version (4.1) to CTAN a few minutes ago.

  • Perfect, it's fixed now! Thanks!
    – gabo_18
    Jun 15, 2022 at 14:31
  • @gabo_18: When I try to compile your code I have exactly the same error: ! Illegal parameter number in definition of \key code > template/derivative/DER IV/long-var-wrap/dv. <to be read again> 2 l.138 } ? This message appears after reading of the l3package/xtemplate file. How did you fix it. My Miktex installation is up to date.
    – JardaFait
    Jun 24, 2022 at 11:30
  • I think it was fixed after an update of diffcoeff, are you sure you have the latest version of the package installed?
    – gabo_18
    Jun 24, 2022 at 13:22
  • Checking my installation of MiKTeX, it hasn't updated diffcoeff yet. (Still has v.4.0 rather than v.4.1.) CTAN has the later version. Jun 25, 2022 at 20:42

In case you don't know how to fix this problem, download diffcoeff.zip from CTAN (version 4.1), unzip it, and copy diffcoef.sty in the folder you are working (the one that has your main tex file). Let's hope CTAN is going to be updated soon with the last version.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .