I am using the commath package to typeset derivatives and need to use a superscript in the argument supplied to \dpd. What I require is something like

    \dpd{}{X^{(j)}_0} f(X^{(j)}_0)

but this does not compile. There is no problem with subscripts as

    \dpd{}{X_0} f(X^{(j)}_0)

does compile. Does anyone know of a workaround?

(Note sure about the tag used - perhaps someone can suggest something more appropriate?)

  • I realise one may use $\frac{\partial}{\partial X^{(j)}_0} f(X^{(j)}_0)$ but I would like to know if it can be done within the \dpd environment.
    – Freakalien
    Feb 28, 2016 at 3:13
  • I have not used commath package and think it was because there were some issues with it. I haven't found where I thought I read a recommendation to not use this package, but perhaps you should look at this question and the comments and answer: commath and \ifinner. Just an FYI. Feb 28, 2016 at 3:50
  • @Petter Grill I have noticed that the \pd (and \od) environment does a poor job of automatically determining whether a displayed or inline equation is required, but this can be overcome by specifying this manually as \tpd or \dpd etc.
    – Freakalien
    Feb 28, 2016 at 4:06
  • really I wouldn't use commath, so many of its macros are incorrect. Feb 28, 2016 at 14:24
  • @David Carlisle yeah, I see your point. I wish I had used a macro to define the derivatives - a lot quicker to change than going step by step through the document.
    – Freakalien
    Feb 29, 2016 at 4:13

1 Answer 1


Please observe additional parentheses in the solution:



    \dpd{}{{X^{(j)}_0}} f(X^{(j)}_0)


Nevertheless, this package seems to be abandoned. As we cannot expect correcting its bugs, I wouldn't recommend using its macros.

  • Do you know which is the best alternative?
    – Freakalien
    Feb 28, 2016 at 4:10
  • @Freakalien It is easy to write your own macros, remembering about potential double superscript, e.g. \def\dpd#1#2{\dfrac{\mathrm{d}{#1}}{\mathrm{d}{#2}}}. Feb 28, 2016 at 4:17

You must log in to answer this question.

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