# What's the proper way to typeset a differential operator?

I can't seem to find any consensus on the right way to typeset a differential operator, whether it is:

• in a standalone context:
• as part of a derivative:
• as part of an integral:

In all of these cases, I have seen them sometimes italicized like variables (as in the second and third examples above) and sometimes not italicized like operator names (as in the first example above). There is also additional variation in how much spacing goes between the "d" and whatever it is acting on.

Seeing as this is an incredibly common symbol in many branches of mathematics, I am curious about the lack of standardization -- I've seen all possible combinations used in all possible contexts by many respected authors and publishers.

Are there any rules of thumb that I can follow? I personally tend to prefer the non-italicized version with very little space next to it, so I add:

\renewcommand{\d}[1]{\ensuremath{\operatorname{d}\!{#1}}}


to my default preamble, and use that everywhere, but I'd like to know if I'm breaking any hard-and-fast rules here.

-
Some related issues: should Euler's e be italicized? how about the imaginary unit i? should single-letter subscripts that are not variables/indices be italicized (eg, "f" in t-subscript-f representing a "final" time)? (Everyone seems to agree that multi-letter subscripts of this type should be roman). My opinion (seems to be shared by many British publishers) is that these should all be roman, along with the differential d. Many US publishers make them all italic. Perhaps there are publishers who use a mix of both, but I don't remember seeing it. –  Lev Bishop Apr 3 '11 at 1:47
Constants like e and i should also be upright. This is covered in the document. –  Emre Apr 3 '11 at 1:57
Interesting -- I was surprised to read that particular rule in the "standard". Still, that seems to be a rule that is universally ignored, whereas the differential rule seems to be split approximately down the middle. –  Adrian Petrescu Apr 3 '11 at 3:12
By the by, I asked this question: tex.stackexchange.com/q/2969/86 partly so that I could write \int_0^1 e^{2\pi i t} d t and have the e, \pi, i, d all automatically typeset upright. –  Loop Space Apr 3 '11 at 19:48
Springer-Verlag's monograph style had \def\D{\mathrm{d}} for the differential operator. I agree with Hendrik Vogt's post below for spacing, that one should typically (but not always) write \,\D x. The exception: after a fraction, e.g., \frac{\sin(x)}{x}\D x is OK; and after a function, e.g., \cos(x)\D x is also OK. But I think there is no single golden rule...it's an art, not a science. –  Alex Nelson Oct 20 '13 at 16:34

There is a standard: it should be upright, not italicized. Read Typesetting mathematics for science and technology according to ISO 31/XI

I suggest using the commath package to correctly typeset differentials.

-
(1) Because most mathematicians (who are, after all, the main group of people writing the most mathematics) are not typography experts, and could care less about your ISO standard. In general, just because something is "standard" doesn't mean people will use/follow it. (2) Because most people are lazy and dx is easier to type than \D{x} –  Willie Wong Apr 3 '11 at 1:11
Who reads ISO documents? –  Emre Apr 3 '11 at 1:12
@Willie: I'm not entirely satisfied by that argument; because mathematicians in general do go to great lengths to have consistent and attractive notation. I regularly see mathematical papers in LaTeX doing much more onerous things than spending three extra keystrokes to get a proper differential. Spivak wrote an entire book about properly typesetting formulas, and he still uses the "incorrect" dx. I suspect it has more to do with a genuine difference in opinion than pure laziness. But I suppose this is not the sort of question that it is easy to settle definitively in either direction :) –  Adrian Petrescu Apr 3 '11 at 1:22
@Adrian I think that one argument that Willie left out was that if you've never seen something typeset a different way, you may never realise that there is a different way to do it. Seeing dx all my life, I never thought that an upright 'd' may be better until I happened to be trying to decide what colour 'd' should be! Then I realised that 'd' was an operator, so should be typeset as such, and that operators were typeset as upright (and blue, since you ask). –  Loop Space Apr 3 '11 at 19:09
@egreg: Hmmm, I'd say that \int ... d. is an operator. So the d by itself may not be an operator but together with the \int it becomes one. –  Loop Space Jun 18 '11 at 16:51

I'd say it really depends on the context. As Emre pointed out, there's an ISO standard; according to wikipedia, ISO 31-11 was superseded in 2009 by ISO 80000-2. The latter carries the title "Quantities and units -- Part 2: Mathematical signs and symbols to be used in the natural sciences and technology".

As a mathematician I think: Why should I use the same notation as, say, an electrical engineer? In some of the sciences they may have good reasons for the choices in the ISO standard, but those reasons need not apply to every field that uses mathematical notation. It appears that I'm not in bad company here: Of course the TeXbook was written before ISO 31, but let me quote some examples from page 168:

On the same page, Knuth also uses the math italic $e$ for the Euler number. For mathematical typesetting, I like Knuth's choices here very much. I can't say anything about other sciences.

-
knuth's choices were based on an extensive study of journals (including acta mathematica (swedish) and transactions of the american math society from the early 20th century) which were considered to have high typographical standards. it's also true that mathematicians came very late to the standards game, as opposed to engineers. (as a former u.s. representative on an iso working group on document processing, i have personal knowledge of this.) not all scientific and technical publishing has the same traditions. –  barbara beeton Apr 3 '11 at 13:31
@barbara: I thought Knuth would have done no less. I didn't write this in my answer, but this is somehow what I meant: It's OK to have different traditions and to follow these. Not everything has to be standardised. –  Hendrik Vogt Apr 3 '11 at 13:34
Personally I prefer the differential operator upright. After all it is an abbreviation like tan or sin, why should this be any different? My late thesis supervisor drilled that in my head. He did type his thesis with an IBM golfball and used to brag about the care and time it took him to typeset it right. He was one of the first persons to adopt TeX in the RSA. –  Yiannis Lazarides Apr 3 '11 at 19:54
@Yiannis: It's a matter of personal taste. But I wouldn't regard "d" as an abbreviation for anything (e.g. "cos" is an abbreviation for "cosine", and the latter is what I say when reading "cos"). –  Hendrik Vogt Apr 3 '11 at 19:58

tl,dr: It's complicated, but be consistent.

I believe the answers here tend to miss the point. While Emre mentions that there is an international norm regarding typesetting mathematics that is very explicit about this topic, Hendrik Vogt makes the right argument, but doesn't take it far enough. This question doesn't have an answer as simple as yes or no, rather it depends on your field, your publishers standard, the location you hail from and your wish for consistency. It's like asking what bibliography style is the right one for science. There are established traditions for typesetting mathematics, in part by the mathematical community of a country or family of countries, in part by the publishers. This transcends this question by far, since this touches a lot of other subjects, e.g. how ellipses, vectors and tensors look (this one has even more variety to offer than our subject) or the appearance of relation symbols, for example.

For example as Beccari points out, this tradition of 'uprighting the differential' is less at home in the pure mathematics than it is in the applied variety or the neighbouring sciences. Physicists and engineers, for example, tend to lean towards the upright form more than the mathematicians.

This however is not even half of the picture, since there tend to be big differences when it comes to the nationality of an author. For example the style fans of slanted differentials are used to originates in the English speaking domain, and coincidental evidence, like all the books in your shelf adhering to that style, only tells us that the books you buy are likely by American publishers. Unfortunately not even the publishers are very consistent in what they put out. I once worked for a rather big European science publisher and on asking how they ensure consistency, they admitted they basically don't. They even just print a Word document, if that's what they get and \LaTeX ing it would be too much effort. Some things don't even have an established convention: I once tried to figure out the correct way to typeset the Laplacian symbol and literally every(!) book I picked up had a different style.

So for the issue at hand: in Russia the integral sign leans left instead of right (Zaitsev), while the upright school of thought (both integral and differential) originates in Central Europe, probably Germany. When you put the integrands at the end, like is common in parts of physics, the spacing also may change between the integral and the differential. Compare this sample to see what i mean:

This shows why in my eyes it is not a very good idea to prescribe upright or slanted for the differential, since people then tend to overlook the integral sign and spacing issues involved, and there is a good chance that whatever answer you give them will be wrong.

Also it is not set in stone where to put the limits, even when adhering to a right leaning integral style, as Knuth has said himself (http://tex.loria.fr/typographie/mathwriting.pdf) (also see Mathematics into Type by Swanson)

In German and Russian tradition, there are indeed conventions and norms where to put it that are adhered to, but even here discretion is advised. DIN, the German equivalent of ISO or ANSI, for example, has the norms 1302, 1304 and 1338 for typesetting mathematical formulas, similar to ISO 80000-2. These norms came out of the particular community and were mainly a write-up of the already established traditions. The ridiculous part comes in form of the DIN norms themselves, because they use the relation symbols inconsistently. The ones preferred by norm 1338 are and , but the majority of the norms published after 1338 use and !, so all of this has to be taken with a grain of salt.

Now you can make an argument for uniformity in the way math is typeset, to make it easier to read and parse. In the end, it really doesn't matter too much, the most important question is, if people can understand it. If you write an undergrad text in your native language then it's likely better to adhere to the traditional style your crowd expects.

I recommend looking at where you come from, who you are writing for, making a choice about those questions and sticking to them! Consistency, within your own documents and even across them, is worth a lot more for your readers than trying to guess the conventions the biggest subset of them may be used to. Defining a macro for yourself that wraps all this and makes it easy to change the look with a simple change in one place is the best practical advice one can give.

It's interesting to note that in a way Latex itself has changed the picture, given its ubiquitous use in the mathematics and the fact that some choices are made for you via the default. A lot of people don't want to mess with things like the issue mentioned. Also, as Zaitsev mentioned, some things, like properly scaling the left leaning integral, seem to be quite hard to achieve, since Knuth didn't have those in mind when designing TeX.

-
Is that Russian example for real? They actually do that? –  Adrian Petrescu Jan 2 '13 at 18:42
With better typography, than i can provide, but essentially yes, see the Zaitsev link i provided. –  Max Jan 2 '13 at 18:43
i've seen the two-line less/greater-than or equal symbol used in the same document with a different meaning than the one-line version (although i can't put my hands on it just now), so even defining a norm can be counterproductive. (after all, the first thing many mathematicians do is define their notation, which may be very idiosyncratic.) –  barbara beeton Jan 2 '13 at 19:14
One could add to your answer that the usage heavily depends on personal preferences. Even inside one community of mathematicians, it varies from author to author. –  Hendrik Vogt Jan 3 '13 at 12:42
I really prefer ⩽ over ≤. Am I a communist now? ;) It just seems much more balanced than ≤. I guess it's better not to go against the tide here though :/ –  Christian Sep 4 '13 at 14:53

This covers the input side of things rather than the display side, but it’s a technique I’ve found useful:

In XeLaTeX or LuaLaTeX, I do something like this:

\newcommand*{\diffdchar}{d}    % or {ⅆ}, or {\mathrm{d}}, or whatever standard you’d like to adhere to
\newcommand*{\dd}{\mathop{\diffdchar\!}}
\catcode\ⅆ=\active
\letⅆ=\dd


Edit: Per egreg’s comment, the newunicodechar package can make this easier, and will work for regular TeX (with \usepackage[utf8]{inputenc} applied):

\newcommand*{\diffdchar}{d}    % or {ⅆ}, or {\mathrm{d}}, or …
\newunicodechar{ⅆ}{\mathop{\diffchar\!}}


In either case,

$yⅆx-xⅆy$
$ⅆxⅆy=rⅆrⅆθ$    % Assuming Xe/LuaLatex, or \newunicodechar{θ}{\theta}

$xⅆy/ⅆx$         % For comparison;
$xⅆy/\!ⅆx$       % need spacing hack for linear fractions,
$x\frac{ⅆy}{ⅆx}$ % ... but built-up fractions are OK.

-
Can you post a screenshot of what this ends up looking like? I don't have a copy of XeTeX/LuaTeX handy. –  Adrian Petrescu Sep 9 '11 at 17:31
With the newunicodechar package this becomes \newunicodechar{ⅆ}{\mathop{\diffchar\!}}, but I'd prefer \newunicodechar{ⅆ}{\mathop{}\!\diffchar}. –  egreg Sep 9 '11 at 22:24
@Adrian: the character that jcsalomon activates is U+2146 (DOUBLE-STRUCK ITALIC SMALL D), that's hardly ever used and stands up well in an editor window. The result is exactly the same as those presented in other answers. With newunicodechar XeTeX and LuaTeX are not needed, it also works with the standard utf8 option for inputenc. –  egreg Sep 9 '11 at 22:29
@egreg, is there any benefit to \mathop{}\!\diffchar over \mathop{\diffchar\!}? –  J. C. Salomon Sep 12 '11 at 18:01
@alfC, also see my gist.github.com/jcsalomon/1325295 where I’ve collected the Unicode characters I’ve found most useful into a handy reference sheet. –  J. C. Salomon Apr 9 at 20:16

I vote for upright e, i and d. In fact, I use upright and sans serif because it makes these symbols stand out clearly, but I haven't seen that used anywhere.

While we're at it, please allow me to point out that when "romanizing" multi-letter suffixes (like, say, "fin" for "final"), it's advisable to go for \textnormal rather than \mathrm, because the latter just renders a bunch of Roman characters side-by-side, without optimizing the spacing to make them look like the abbreviation to a single word.

-
Thank you for the \textnormal tip :) I honestly didn't expect to still be getting useful information out of this question 1.5 years after posting it! –  Adrian Petrescu Nov 9 '12 at 3:34
There is also \text (from amsmath I think) but I don't know the typographic difference. –  marczellm Jan 2 '13 at 19:39
@marczellm \textnormal{#1} is basically \text{\normalfont #1} with some more tweaks. Therefore you use \textnormal for sin, but \text for if and only if. The reason is that sin should be upright even in for instance a theorem statement, whereas if and only if as a part of a displayed equation should be italic in a theorem statement (given you typeset theorems in italics). –  tohecz May 31 '13 at 10:39
@tohecz Thank you. I use \sin though :) –  marczellm May 31 '13 at 11:18
@marczellm That's of course correct. But if you wanted to define it manually, \mathop{\textnormal{sin}} would be much better than \mathop{\text{sin}}. –  tohecz May 31 '13 at 19:24

Upright feels more correct, but it is very rarely used and it looks ugly (though I may just think so because I'm so used to seeing the alternative). Personally, I prefer going with the alternative which is most often used and least ugly.

I use \mathop{dx} to get the correct spacing before and after differentials. Thus, it will be apparent that "dx" is its own entity, and not a d multiplied by an x, and it nicely separates the differentials:

-
I completely agree with this, except "Upright feels more correct." Actually it doesn't, and all I know is how I saw my teachers and texts write dx (with both italicized.. and this happens everywhere from Numerical Recipes to Salas and Hille's Calculus text to Schaum's outlines.) I've actually never, to my recollection, seen an upright d and an italicized x together, to my recollection. Far as I'm concerned dx is the correct way to right it. –  bobobobo May 11 '12 at 19:18
\mathop{dx}, {dv} {dt} ... etc used for my thesis, simple and stand alone from other symbols. –  KOF Jan 12 '13 at 7:23
+1 because this seems to be smart solution. But IMO something like \mathop{\mathrm{d}x} looks also decent. –  doc Feb 3 '13 at 16:22

"Scientific Style and Format - The CSE Manual for Authors, Editors, and Publishers" suggests using roman(upright) d to typeset differential operators (CSE 7th ed, page 160). As someone already pointed out, authors, in general, don't care whether it shows up as italics dt or not. It is left mostly to technical copyeditors like me to fix this. - Dave Ledesma

-
I do care very much that it shows up as italic :-)` –  Hendrik Vogt Jul 2 '11 at 16:26