Basic use of derivative with cool package fails with "Missing \endcsname inserted"

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}  }%
{%
\def\COOL@tempd%
{\csname COOL@deriv@powers@\roman{COOL@multideriv}\endcsname}%
\isint{\COOL@tempd}{COOL@isint}%
\stepcounter{COOL@multideriv}%
}

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}}

I use the following macro to set multiple partial derivatives:

\newcommand*\mdiff[3]{\frac{\partial^{#2}{#1}}{\pABLN{#3}}}
\newcounter{pABLCounter}
\def\pABLN#1{\setcounter{pABLCounter}{1}\xpABLN#1;pABLEnde;}
\def\pABLEnde{pABLEnde}
\def\xpABLN#1;{\def\temp{#1}%
  \ifx\temp\pABLEnde
  \else 
    \stepcounter{pABLCounter}
    \ifodd \value{pABLCounter} 
      \if1#1\,\else {{}^{#1}\,}\fi%
      \else{\partial{#1}}% 
    \fi %
    \expandafter\xpABLN
  \fi  
}

to set in your case:

\mdiff{f}{3}{x;1;y;1;z;1}

other possibilities are:

\mdiff{f}{5}{x;1;z;4}

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

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

Tags:

Math Mode