80

This is a general question about mathematical writing especially for writing research papers and the like.

Question: Do you precede an equation with a comma or colon?

Example A:

  1. The following equation is the Yosida-Hawking-Penrose-Dantzig function \begin{equation} f(x) = \frac{1}{2} D_\alpha(x,y) \end{equation}
  2. The following equation is the Yosida-Hawking-Penrose-Dantzig function, \begin{equation} f(x) = \frac{1}{2} D_\alpha(x,y) \end{equation}
  3. The following equation is the Yosida-Hawking-Penrose-Dantzig function: \begin{equation} f(x) = \frac{1}{2} D_\alpha(x,y) \end{equation}

Example B:

  1. In fact, we can express the earlier function using a much simpler expression \begin{equation} f(x) = \varphi(x,y) \end{equation} where $\varphi(x,y)$ is the Demiane functional
  2. In fact, we can express the earlier function using a much simpler expression, \begin{equation} f(x) = \varphi(x,y) \end{equation} where $\varphi(x,y)$ is the Demiane functional
  3. In fact, we can express the earlier function using a much simpler expression: \begin{equation} f(x) = \varphi(x,y) \end{equation} where $\varphi(x,y)$ is the Demiane functional

Can anyone comment on which one is the best practice?

psmears
  • 767
  • I would go for colons in first and comma in the second, at the very least use full stops after equations. this amongst many others may be helpful, but at the same time, should it be moved to a chat or flagged as duplicate? – mdave16 Apr 02 '17 at 03:43
  • 4
    Tangential comment, but the equation and the function are two different things (they are not even the same type of thing), so I might avoid saying that the equation "is" the function. – littleO Apr 02 '17 at 03:47
  • 2
    This has also been discussed at MathOverflow. – pjs36 Apr 02 '17 at 03:55
  • 11
    You should have "following" instead of "follow". ​ ​ –  Apr 02 '17 at 04:57
  • I find it interesting that none of the answers to date distinguish between a displayed equation and an in-line equation. My gut is telling me that there are differences between the two cases, although I have trouble articulating what they are (which is why I am not answering myself yet). – mweiss Apr 02 '17 at 17:30
  • 2
    I agree with what the others have said, but if you precede the equation with a comma as in the second example and then continue the sentence after the equation, you should put a comma after the equation itself also. This is hinted by Olivier's answer. – Darren Ringer Apr 02 '17 at 19:04
  • In example A, we have a 4th option: precede a (non-inline) equation with a full stop. – Cyriac Antony Jan 05 '19 at 07:33

6 Answers6

118

Generally, I would treat the equation as if it were any ordinary noun phrase, and use the usual rules for comma, colon, or no punctuation.

A colon is used if the equation is an elaboration, or an item. So, just as you might write

Lips are characterized by the following properties: fleshy, paired, red.

you would write

An ellipse is characterized by the following equation:

$$ \frac{x^2}{a^2}+\frac{y^2}{b^2} = 1 $$

A comma precedes a non-restrictive clause (one that describes rather than identifies the noun phrase), so by analogy with

The line can be assigned to a simpler character, Polonius.

we might write

A line can be described with a simpler equation,

$$ y = mx+b $$

In comparison, with a restrictive clause, we use no comma, so just as we would write

From this, the oiler obtained the formula CH$_3$C$_6$H$_4$C$_2$H$_5$.

we would also write

From this, Euler obtained the formula

$$ e^{i\pi}+1 = 0 $$

I suspect there aren't any hard and fast rules for this, however. Whatever you choose to do, be consistent and reasonable.


ETA (2017-09-10): You'll notice that I have no periods at the ends of these equations. The papers I have generally (though not universally) observe this pattern. However, in other fields, equations may have ending punctuation depending on how they occur within a sentence. It may be useful for a writer to consult the publication's style guide, if applicable, or at least examine previous articles within the same publication or outlet.


ETA (2022-05-01): Somewhat coincidentally, on the same day (today), I both (a) received a straggling upvote on this rather middle-aged answer, and (b) found the following in the foreword to the third edition of Ian Stewart's classic book, Galois Theory (2004):

[after discussing the need for punctuation for formulas in the main body of the text] But I have come to the conclusion that eliminating visual junk from the printed page is more important than punctuatory pedantry, so that when the same formula is displayed, for example

$$ t^2+1 $$

then it looks silly if the comma is included, like this,

$$ t^2+1, $$

and everything is much cleaner and less ambiguous without punctuation.

Purists will hate this, though many of them would not have noticed had I not pointed it out here. Until recently, I would have agreed. But I think it is time we accepted that the act of displaying a formula equips it with implicit (invisible) punctuation. This is the $21$st century, and typography has moved on.

Brian Tung
  • 34,160
  • 44
    Good answer. But are you not forgetting the dots at the end of the sentences? :^) – Olivier Apr 02 '17 at 04:02
  • @Brian I would appreciate that you take a look at my answer and provide appropriate feedback. There seems to be a misunderstanding... – Olivier Apr 02 '17 at 04:09
  • @Olivier: Sorry, but this time, it seems some comments have been deleted. I will say that I think your formatting is defensible, but it is not the only reasonable approach. And equations swallow the period. :-) – Brian Tung Apr 02 '17 at 04:31
  • @Brian Thanks for the feedback. I deleted my comments that encouraged an empty conversation. In scientific articles, there is a period at the end of equations ending a sentence. See this very well written article published in the Annals of Applied Probability, for instance. – Olivier Apr 02 '17 at 04:41
  • @Olivier: Interesting, but I would say that though that is reasonable, it is not universal. There are plenty of articles where no punctuation would be used in those places. I tend to find it distracting, but not unreasonable. – Brian Tung Apr 02 '17 at 04:50
  • 39
    What about periods at the end of the equations if they end the sentence? Like $$e^{i\pi}+1=0.$$ – Ruslan Apr 02 '17 at 06:39
  • @Ruslan: I would say that that is not unknown, but I don't see it that often. That may be a consequence of the papers/books I read, however. – Brian Tung Apr 02 '17 at 16:49
  • 13
    @BrianTung I have never seen periods not used after equations ending a sentence (examples of what I read are given in my answer). Can you provide an example of this from what you consider an exemplary publication? – Olivier Apr 02 '17 at 21:06
  • 7
    @Olivier: I'm in computer science. I just looked over some papers that appeared in IEEE Security and Privacy, and lo and behold, it's a mixed bag. About one paper in five seems to have the periods at the end. That confirms the notion that it's a matter of what papers one reads. I'll edit my answer accordingly. Thanks for the tip! – Brian Tung Apr 03 '17 at 00:44
  • 2
    But this is asking about mathematical papers, not IEEE Security and Privacy? Within mathematical papers, I have never seen a paper drop punctuation or commas after an equation =) – N3buchadnezzar Apr 03 '17 at 04:07
  • What if the equation is inline in the paragraph rather than on it's own line? – Readin Apr 03 '17 at 04:35
  • @N3buchadnezzar: There are mathematical equations in IEEE S&P. But I won't contest the primacy of mathematics journals. I'll look at those papers at work tomorrow; I have some of them there. – Brian Tung Apr 03 '17 at 06:10
  • 1
    @Readin: I would probably put a period after it. But you know, I almost never put in an equation inline at the end of a sentence—possibly because subconsciously I want to avoid having a period end the equation. I suspect my hangup has to do with overloading the period. – Brian Tung Apr 03 '17 at 06:11
  • Haha "oiler" - love it! – Jannik Pitt Apr 03 '17 at 15:48
  • When typing displayed equations in $\LaTeX$, I add a thin space (\,) after the equation but before the punctuation. For instance: \begin{equation*}a^2 + b^2 = c^2 \,. \end{equation*}. The idea is to try and to make it clear that the punctuation is part of the sentence, not the equation or expression being displayed. Not sure how common this is, but I find it helps the eye if you're displaying set-builder notation, or use \dots somewhere. I've seen this recommended on various TeX Stack Exchange answers, but see also this MathOverflow post. – David Robertson Apr 03 '17 at 18:24
  • @DavidRobertson: Yes, I've seen this too. – Brian Tung Apr 03 '17 at 19:32
  • @pjs36 What's the Euler pun? – Yashas Apr 04 '17 at 02:03
  • 2
    @YashasSamaga Euler's last name is pronounced exactly like "oiler" (at least in the US, where the uninitiated often pronounce it "yoo-ler"), so the last pair of examples is funny to me (maybe "pun" isn't exactly the right word). – pjs36 Apr 04 '17 at 03:27
  • 1
    "Generally, I would treat the equation as if it were any ordinary noun phrase, and use the usual rules for comma, colon, or no punctuation." I'll just be one more voice in this comment thread that thinks this rule extends to the use of a period following an equation if it ends the sentence. – Austin Mohr Apr 05 '17 at 19:20
  • 1
    @AustinMohr: Fair enough, duly noted :-P – Brian Tung Apr 05 '17 at 19:36
  • Excellent answer. Re: periods and equations, I put periods at the end of equations that are the end of sentences and in-line. Out of line equations I don't give periods to. – Stella Biderman Apr 08 '17 at 14:52
  • Thanks, noble editor, but I think I'd prefer to let the answer stand as is, with the comments discussing the presence or absence of the displayed equations. – Brian Tung Sep 10 '17 at 06:23
  • Agree completely regarding the pedantic punctuation comment.

    Do any of the punctuation hardliners include commas after each line in a series of equation modifications when using an AMS align environment and a period after the last. It would be very distracting and very ugly. Actually, my junior high grammar teacher might argue that one should use semicolons followed by an ending period. Even uglier and more distracting.

    The priority of writing is to convey ideas not to obey schoolmarms.

    – Robert McLean MD PhD Nov 25 '22 at 20:55
28

Equations should be included as part of the sentence, as in the following.

Consider the Yosida-Hawking-Penrose-Dantzig function $$ f(x) = \frac{1}{2}D_\alpha(x,y). $$

It can also be expressed as $$f(x)=\phi(x,y),$$ where $\phi(x,y)$ is the Demiane functional.

In example B, if you don't want to change the sentence:

In fact, we can express the earlier function using the much simpler expression $$f(x)=\phi(x,y),$$ where $\phi(x,y)$ is the Demiane functional.

I use this style example. Milnor's book, referenced in the comments below, follows the same rules, as do all the references and publications in my bookshelf (Polya's Problems and Theorems in Analysis, Rudin's Real and Complex analysis, etc.)

Standard guides

Dandelion
  • 163
Olivier
  • 3,893
  • 1
    For what it's worth, your principle is correct (the formula is part of the sentence that surrounds it and punctuation should be applied accordingly) and your last two examples look fine to me. But sentences sometimes contain commas or colons, and sometimes those occur just before a formula. I would put a comma after "function" in your first example. – David K Apr 02 '17 at 04:52
  • 3
    I think your first example is standard, grammatically correct, and clear. I read such statements often in math writing. For example I think a similar statement appears on p. 35 of Milnor's book Topology from the Differentiable Viewpoint: "The sum ... is equal to the Euler number $\chi(M) = \sum_{i=0}^m (-1)^i , \text{rank} , H_i(M)$." (The formula for $\chi$ is displayed on its own line, as is the formula for $f$ in your first example.) – littleO Apr 02 '17 at 04:57
  • 1
    Another example, from one of Terence Tao's blog posts, is shown in this image: http://imgur.com/gallery/XmOvO Notice the lack of a comma after the word "function". – littleO Apr 02 '17 at 05:22
  • 4
    @ThomasAndrews rather "Consider the scientist Stephen Hawking. It can also be expressed as something, where whatever". Nevertheless, the OP started with examples conatining "follow[ing]". There, I'd use a colon: "The following person is a scientist: Stephen Hawking." – Hagen von Eitzen Apr 02 '17 at 22:00
7

No punctuation should be used between the word "function" and an immediately following expression that defines it, unless "the function" has already been defined and its expression in the text is just a convenient reminder of its definition. Exactly the same applies in ordinary Language. Compare, for example the following two sentences:

My sister Laura lives in London.

My sister, Laura, lives in London.

The second sentence implies that "my sister" has already been defined, perhaps as the only sister or the sister who was previously discussed. In contrast, the first sentence makes no such implication: Laura, as far as we can tell from the sentence, might be any one of many sisters; but the sentence does specify which sister is being considered.

In general, the punctuation of mathematical writing should follow that of the corresponding natural language. In particular, a mathematical expression that ends a sentence should be followed by a full stop.

John Bentin
  • 18,454
6

This is what I remember from my technical writing class of twenty years ago.

The most important thing is that a colon must only be used at the end of a complete sentence.

For example

A line can be excpressed as: $$y=mx + b.$$

is incorrect, and

A line can be expressed as $$y=mx + b$$

and

The following equation is the slope-intercept equation of a line: $$y = mx + b$$

are correct

5

For papers, it always depends on what is specified in the style guide for the publication or journal. Having said that, however, the guide is often not so specific as to whether the sentence with the equation should be punctuated with commas, colons or little flags.

For example, from the Monthly Notices of the Royal Astronomical Society

Mathematics

...

Equations should be punctuated as part of the sentence. Displayed equations are ranged left (i.e. no indent). Numbering of equations should follow the convention (1), (2)… throughout the whole paper, or (2.1), (2.2)… by section. Equations in appendices should be numbered (A1), (A2), (B1), etc.

This is indented, but still accepted: image from paper at https://arxiv.org/pdf/1401.2593.pdf

edit: added picture

image from paper at https://arxiv.org/pdf/1401.2593.pdf

Much seems to depend how particular/pedantic a reviewer is in relation to the style guide (which they may not know in such detail for specifics like this), and grammar conventions are not universal.

Check the style guide, read some of the published papers from the journal in question, and be consistent in application of grammar rules when inserting equations.

Mick
  • 159
  • The editor of a journal has just asked me politely to check the Editorial Style Guide. I think the most noticeable deviations of mine were to end equations with a comma if "where a denotes..." followed, and ended with a dot if it was the end of the sentence. – Horror Vacui Dec 01 '21 at 20:38
-3

I was told to use correct punctuation as defined by grammatical rules, but to always place the equation or formula on a line of its own, even if this meant starting a line with a punctuation mark. Even though the layout may look a little odd there can be no confusion as to the meaning. While it would be very rare for a comma to be misconstrued imagine the confusion an exclamation mark would cause.

  • My experience is that an equation earns its own line in a paper only when it is complicated or important enough to merit the additional space. – Austin Mohr Apr 05 '17 at 19:23