Hacker News new | ask | show | jobs
by quietbritishjim 1265 days ago
It also doesn't mention the spacing after the dx. You need spacing afterwards, but also not unconditionally if the thing afterwards also has a space before (that sounds obvious but I can imagine a macro that has \,\mathrm{d}#1\,).

There is a better way to do this, which is to use LaTeX's built in spacing adjustment, which is different around different types of object (e.g. notice how ab+cd already looks right). To do that, use: \mathop{\mathrm{d}#1}

Even if you carefully do the "right thing", the spacing in LaTeX is by no means perfect. E.g. just look at f(x)g\left(\frac{x}{y}\right) - it looks like g is more associated with f's arguments than its own.