# cool package derivative and eulervm \mathbold fails with 'Missing control sequence inserted.'

Compiling

\documentclass{article}

\usepackage{cool}
\usepackage{eulervm}

\begin{document}

$\D{a}{T}$
$\pderiv{a}{T}$

$\mathbold{T}$

$\D{a}{\mathbold{T}}$
$\pderiv{a}{\mathbold{T}}$

\end{document}


works until the derivatives are evaluated for bold euler letters. It fails with

! Missing control sequence inserted.
<inserted text>
\inaccessible
l.13     $\D{a}{\mathbold{T}}$


Perhaps this is related to Basic use of derivative with cool package fails with “Missing \endcsname inserted” but the fix proposed there does not work.

-
The package cool uses many \edef commands and most of them should be \protected@edef. – egreg Feb 12 '13 at 23:39
Is it possible to inform the maintainer of this issue? The last version seems to be of 2006. – jmartinez Feb 13 '13 at 10:06

The error message is usually a sign of a fragile command in a moving argument, so a guess of making something robust seems to work:

\documentclass{article}

\usepackage{cool}
\usepackage{eulervm}

\let\oldmb\mathbold
\protected\def\mathbold{\oldmb}
\begin{document}

$\D{a}{T}$
$\pderiv{a}{T}$

$\mathbold{T}$

$\D{a}{\mathbold{T}}$
$\pderiv{a}{\mathbold{T}}$

\end{document}


This method also fixes Undefined control sequence and TeX capacity exceeded, sorry [parameter stack size=10000] errors that occur when using cool commands such as \D or \pderiv with denominator arguments containing math accents like \tilde and \dot.

-
Greate, thanks, I didn't knew about the existence of fragile commands, but protecting them seems to work! :) – jmartinez Feb 12 '13 at 22:56