3

I know the question of punctuation at the end of displayed equations has been discussed many times in here (see e.g. here). However, as far as I see, one of the elephants in the room has never really been properly addressed: Suppose I type the following:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

Consider the Pythagorean identity \begin{equation} c^2 = a^2 + b^2, \end{equation} and let us try to generalize it to non-right triangles.

\end{document}

Then the comma at the end of the equation will be taken from the math font, not the text font from which all the inline commas in the document will be taken. Depending on your font settings, these two commas may look quite different.

Furthermore, suppose that this takes place inside a theorem environment:

\documentclass{article}

\usepackage{amsmath,amsthm}

\newtheorem{theorem}{Theorem}

\begin{document}

Consider the Pythagorean identity \begin{equation} c^2 = a^2 + b^2, \end{equation} and let us try to generalize it to non-right triangles.

\begin{theorem} If ( \gamma )~denotes the angle of the triangle, we have \begin{equation} c^2 = a^2 + b^2 - 2ab \cos(\gamma), \end{equation} which generalizes the usual Pythagorean identity. \end{theorem}

\end{document}

enter image description here

See, the first comma is italic and the second is not! Is that really the way it’s supposed to be? Shouldn’t I be using \text{,} consistently in displayed math?

In other words, would the following not be the better solution?

\documentclass{article}

\usepackage{amsmath,amsthm}

\newtheorem{theorem}{Theorem}

\begin{document}

Consider the Pythagorean identity \begin{equation} c^2 = a^2 + b^2 \text{,} \end{equation} and let us try to generalize it to non-right triangles.

\begin{theorem} If ( \gamma )~denotes the angle of the triangle, we have \begin{equation} c^2 = a^2 + b^2 - 2ab \cos(\gamma) \text{,} \end{equation} which generalizes the usual Pythagorean identity. \end{theorem}

\end{document}

enter image description here

Gaussler
  • 12,801
  • 1
    \text if you must, but personally I'd avoid trailing punctuation in display math and omit the comma. – David Carlisle Apr 25 '23 at 08:43
  • @DavidCarlisle Well, as has been discussed many times, that is a matter of style, and it seems to me that the majority of mathematicians use punctuation in displayed math. – Gaussler Apr 25 '23 at 09:03
  • sure which is why I said "personally" ... so preference would be no comma, but in practice do whatever the journal editor wants:-) – David Carlisle Apr 25 '23 at 09:34
  • 1
    I personally use \text as well, I guess most people don't and I am just nitpicking, but I can't help it. – user242429 Apr 25 '23 at 10:01
  • I go to lengths to try to avoid puncutaiton in diplay mode, mostly by ending the sentences with where .... I was also taught that commas are overused in normal text. – John Kormylo Apr 25 '23 at 12:37

0 Answers0