[Tex/LaTex] short hand command to write derivatives


Every time I want to write an (ordinary) derivative I have to use frac, like this:

\frac{\mathrm{d}^2 \omega}{\mathrm{d}\theta^2}

Or using \partial for partial derivatives.

Is there a package or a command that takes, for instance, (Ordinary or Partial, Power of derivative, variables) and outputs the formatted expression?

Best Answer

You can use the esdiff package, which has handy macros for derivatives and partial derivatives, taking care of indices. Here is a demo;




     \diff{f}{x} &\qquad \diff*[4]{g}{t}{t = 1} \\[2ex]
     \diffp{f}{x} &\qquad\diffp{g}{tu}& & \qquad & \diffp*{g}{{t^2}{u^3}}{(0,0)}


enter image description here

Related Question