[Tex/LaTex] Thermodynamic partial derivatives

math-mode

Does anyone have any ideas how to make this:

enter image description here

look like this:

enter image description here

The only difference is the differentials are "pushed over" making it appear more compact and readable. I achieved the first picture by using

\left. \frac{\partial U}{\partial S} \right|_{V,N} \mathrm{d} S

(first term only) but I don't know how to push the dS over the subscript more. Can this even be done?

I've tried \overset and using a custom fraction but neither look quite right.

Best Answer

\documentclass{article}
\usepackage{mathtools}
\begin{document}

\[
\left. \frac{\partial U}{\partial S} \right|_{\mathrlap{V,N}} \mathrm{d} S
\]

\end{document}