In exploring options for typesetting derivatives I came across the cool package. But a basic example from Page 22 of the Content Oriented LaTeX documentation (October 7, 2006) seems to result in the error:

 Missing \endcsname inserted.
  <to be read again> 

Uncommenting the line in the MWE below yields the above error. As is, the MWE produces:

enter image description here


  • Can I have a flexible partial derivative macro? I would prefer to use one of the solutions mentioned here as they do not require another package, but the syntax proposed here is different that the cool package. This is problematic in that if I later need the flexibility provided by the the cool package will not be as easy to switch.


    \D[1]{f}{x,y,z} &= \cdots\\
    %\D[2,n,3]{f}{x,y,z} &= x
  • I can't help you. But I want to say that I think it's easier to create an own command based on LaTeX3. – Marco Daniel May 4 '12 at 18:11
  • 1
    Also note that according to ISO 31/XI the differential operator should be upright. – Wouter Donders May 4 '12 at 18:46
  • @MarcoDaniel: That would be acceptable, but would prefer that they use a similar syntax as the cool package in case I need to switch at some later date. The question I linked to provides some nice options, but with a different syntax. – Peter Grill May 4 '12 at 19:14
  • 1
    @Waldheri: Besides the minor issue like not working :-), that is one of the things I don't like about the cool package. But, I assume that there is probably a way to patch that as well. – Peter Grill May 4 '12 at 19:15
  • Copying one of the doc examples produces errors. I don't have here older TeX Live versions to test, but the error is the same with TeX Live 2010. – egreg May 4 '12 at 19:39

This is a bug in the cool package v1.35 (2006/12/29). Lines 2056 to 2063 read

\whiledo{ \boolean{COOL@isint} \AND
\NOT \value{COOL@multideriv}>\value{COOL@ct}  }%
{\csname COOL@deriv@powers@\roman{COOL@multideriv}\endcsname}%

The \def (line 2059) must be an \edef. After changing it (in a local copy, of course) the MWE ran without errors.

BTW: the style of the “d” can be changed through:

\Style{DSymb={\mathrm d}}
  • Brilliant! Ages ago (I think after reading the question that Peter links to), I tried the cool package, ran into a problem, and gave up. Looking at my test file, I appear to have gotten stuck with commands of the form \COOL@deriv@powers@ii not being defined which looks extremely like what this fixes. Looks like cool might just be cool again. – Andrew Stacey May 4 '12 at 20:28
  • @AndrewStacey Unfortunately there doesn't seem to be a contact address to send a bug report to :( – cgnieder May 4 '12 at 20:48
  • @cgnieder: Google led me to the author's website, where he explains how to write his email address. – Matthew Leingang Mar 6 '13 at 3:30
  • @MatthewLeingang Curious... I was sure I tried google, too. Anyway, thanks! I'll contact him. – cgnieder Mar 6 '13 at 7:34
  • @cgnieder: I'm sure you did, too. I used keywords n setzer cool latex and that led me to nsetzer.com. I'm not sure how active he is...the site has not been updated in a while. If he's not responsive I believe there is a CTAN process for taking over maintenance. – Matthew Leingang Mar 6 '13 at 14:12

I use the following macro to set multiple partial derivatives:

    \ifodd \value{pABLCounter} 
      \if1#1\,\else {{}^{#1}\,}\fi%
    \fi %

to set in your case:


other possibilities are:


giving \frac{\partial^5f}{\partial x\partial z^4}.

If you really want d instead of \partial just replace it in the code.

  • Can you not improve you macro to require only 2 argument? The second argument can be computed from the third 3. This would surely make it less error prone. – Walter May 13 '12 at 17:05
  • @Walter but then I coudn't write things like \mdiff{f}{m+n}{x;m;y;n} – Peter Breitfeld May 13 '12 at 20:02

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.