David's answer is mostly OK, but his proposal includes several parts which are not OK. Specifically:
- When editing someone else's post:
- If they use plain
d
and there is no indication the choice to make it italic was intentional, you can change differential d
to \mathrm{d}
.
No, no, no. If the post uses plain d
and there is no indication that the choice to make it italic was intentional, then leave it alone.
The choice between straight $\mathrm d$ and italic $d$ is a stylistic choice; if you find a post that makes that choice differently than you would have done it, then tough luck. Live with it and move on. It just isn't that important. You do not get to change that user's stylistic choices, and you do not get to introduce non-rendering source clutter like \mathit{d}
into that user's source.
David's point 4 needs to read as follows:
- When editing someone else's post:
- If they use plain
d
and there are active indications that the stylistic choice wasn't intentional, you can change differential d
to \mathrm{d}
.
Active indications that the stylistic choice wasn't intentional can include things like sloppy formatting overall, both in the maths and in the grammar and punctuation. This is obviously a subjective judgement and there's a significant gray area, so err on the side of letting the existing formatting stand.
Why is this? Because it is a perfectly acceptable choice to have render one's differentials in italics and to use straight d
s to render them to avoid the clutter in source that's meant to be human-readable. In this vein, consider as an example the following block of LaTeX source:
$$
\int_0^1
\int_0^\pi
J_\nu\mathopen{}\left(
\sqrt{1-\frac{d f}{d\varphi}(0) \rho^2}
\cos(\varphi)
\right)\mathclose{}
\exp\mathopen{}\left(
i k\rho \cos(\varphi)
+ i \nu \varphi
+ \frac{d g}{d\rho}(\rho+\delta\rho)
\right)\mathclose{}
\: d\varphi
\: d\rho
$$
There are multiple indications here that the user knows what they are doing and that every choice done here is intentional. There aren't any \mathit{d}
s here and they would actively harm the readability of the source, so they should not be introduced, no matter how much your inner typesetting pedant wants you to.
Why am I harping on and on about source readability? Because the site standard for site formatting is Markdown, which is explicitly designed to make both the source and the output human-readable. We should aim to have the same goal where MathJax is involved.
David's stated aim,
it's useful to be able to edit posts where people don't really care about the notation to match a convention, while allowing people who do have a specific preference to express that
is good enough, but you should not need to add readability-harming clutter to your source to prevent other users from deciding that they don't like your stylistic choices. There is an ambiguity in plain d
s between the authorial intent "I want my differentials italicized, and I don't want to bother with semantic \mathit{d}
s" and "I don't care about the difference between $d$s and $\mathrm d$s". Unless you can break that ambiguity through other means, the rule of thumb is to leave it as is.