Partial derivative shortcut in LaTeX

This is incredibly simple code but may be of use to some people. Typing out derivatives in LaTeX (e.g. \(\frac{\partial y}{\partial x}\)) can be shortened.

Add this line of code to the header of your document:
[code]
\newcommand{\dydx}[2]{\frac{\partial{#1}}{\partial{#2}}}
[/code]

This creates a new command \dydx that takes two arguments, e.g. \dydx{P}{\tau}. Include this command in math mode (e.g. encased in dollar signs) and it will produce \(\frac{\partial P}{\partial \tau}\).

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top