38

If I write

If $x \rightarrow y$, then $y \rightarrow z$.

it looks fine. But if the sentence is more involved and formulas longer, I tend to change $...$ to \[...\]. In many cases I think the result is ok, especially if there's only one equation in the end of the sentence.

However, in the above example it would be like:


If

     x→y

, then

     y→z

.


The comma and period doesn't look very nice.

Sure, I could break it up and say If formula (1) holds, then formula (2) holds, but this is usually an overkill in my opinion.

TL;DR: What do you do with periods after sentences ending with a \[...\]-equation?

1

2 Answers 2

45

You insert the period as part of the equation and therefore also in math mode, as opposed to putting it outside the equation.

enter image description here

\documentclass{article}
\begin{document}
If \[x\rightarrow y,\] then \[y\rightarrow z.\]
\end{document}

Naturally, this may lead to a slightly off-center spacing due to the punctuation (albeit marginally visible). However, to correct for this, you can use \phantom{<punct>} on the opposite side:

\documentclass{article}
\begin{document}
If \[\phantom{,}x\rightarrow y,\] then \[\phantom{.}y\rightarrow z.\]
\end{document}
7
  • 2
    Ok, yea, that's obviously an option. You know for sure that this common practice?
    – aioobe
    Oct 27, 2011 at 8:00
  • 3
    Since equations (or mathematics in general, whether in-line \textstyle or in \displaystyle) form part of the textual flow, it is my opinion that they can include punctuation. If you want to correct for the possible centered misalignment, see my updated answer.
    – Werner
    Oct 27, 2011 at 8:09
  • 1
    Nice update :-)
    – aioobe
    Oct 27, 2011 at 8:14
  • 1
    @nordev: Sure, or a regular \rlap as there is no difference in your use of punctuation in the equation compared to a regular text-based period .. Hopefully your equation is not just oversized so the \rlap stretches into the margin.
    – Werner
    Aug 11, 2015 at 23:24
  • 2
    Why not use \text{.} (or maybe \text. if you want to keep it short)? Depending on your setup (an extreme case being using OpenDyslexic as the main text font, for example), this might lead to much more consistent punctuation between normal sentences and “sentences that end with math stuff”.
    – Alice M.
    Oct 10, 2017 at 16:44
21

Punctuation in displayed formulas should stay within the formula:

If
\[
x\to y,
\]
then
\[
y\to z.
\]

Some people leave a space before the punctuation (I don't); others completely suppress punctuation in displayed formulas, on the basis that the display is doing the work and the reader can infer commas or periods from the context.

Which style to use is a question of personal taste; the most important thing is to be coherent along the document.

2
  • +1, nice answer. I like the "reader can infer commas" part :-) (seems slightly nastier to let the reader infer periods though)
    – aioobe
    Oct 27, 2011 at 8:06
  • 1
    @aioobe That's why I always use punctuation also in displayed formulas; in rare cases this needs rephrasing in order to avoid ambiguities in formulas, but I prefer to be consistent. In the "no punctuation" style, the presence of a period can be inferred by a following capital letter.
    – egreg
    Oct 27, 2011 at 8:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .