This semester I’ve been adamant in writing up all my homework in LaTeX. While time consuming, I’ve become far more proficient with the language. Frankly, I also think it helps you get better grades. Rewriting handwritten work onto a computer forces you to be explicit in what you did, and your submission looks far more professional.

With that said, it’s a sometimes a pain because of how tedious certain aspects are. For example, consider a partial differential equation with constants:

$\left( \frac{\partial U}{\partial S} \right)_{V, n_i} = T$

\left( \frac{\partial U}{\partial S} \right)_{V, n_i} = T


We can improve our experience by using the predefined partial derivative function from the physics package, but that still requires left and right parenthesis as well as manually subscripting the variables held constant.

%included in your document header
\usepackage{physics}
\left( \pdv{U}{S} \right)_{V, n_i} = T


Let’s not forget LaTeX is a programming language! We can be smart about this and automate it by defining our own function, \pdvc, (partial derivative with constants) and build off of \pdv from physics.

%include this in your document header
%#1 is the numerator term, #2 is the denominator term,
%and #3 are the variables held constant
\usepackage{physics}
\newcommand{\pdvc}[3]{\left( {\pdv{#1}{#2}} \right)_{#3}}