# “$$…$$.” has the dot on the wrong line; How to punctuate correctly?

I like to use the $$\sum S_{i}$$ or something similar. But I get the dot . or the comma , placed in an awkward position. I work around this problem sometimes by using $\sum S$, but this is not good to stress things. Then again to be more specific, I use

$$...$$


but I have noted that I overuse the latter so I want to somehow have the comma typeset the correct way when I use $$something$$. Please note that in some languages comma is used to separate connected clauses -- this differs from English! But, suppose I want to use $$....$$, where ... or how can I write ...in other words it means $$...$$. where I have used the period. Using it as-is, it comes after the equation on the next line. How can I fix this?

In the example below, how can I fix the comma or the dot?

$$\sum S$$, where I have nothing really to say in this example.


It is $$\sum S$$.

-
Related questions: For formal articles, should a displayed equation be followed by a punctuation to conform to the language grammar ? and Punctuation in equations. And you shouldn't use $$...$$ in LaTeX documents; you should use $...$ instead. – Gonzalo Medina Sep 29 '11 at 0:58
@hhh: I edited your post and used some mark-up (by using backticks) to highlight what you're after. Feel free to roll back or re-edit if I misinterpreted your original question. Do so by clicking on the edit link at the bottom of your post. – Werner Sep 29 '11 at 3:01
The $$...$$ vs. $...$ matter has actually been explained on here already: tex.stackexchange.com/questions/503/why-is-preferable-to – doncherry Sep 29 '11 at 16:49

As @Gonzalo mentioned in his comment, you should use $...$ instead of $$...$$ for displayed math equations. Consider reading more about this (and other LaTeX2e tabu's) by viewing the l2tabu documentation.

Regardless, you have two choices, depending on whether you write a displaystyle $...$ or textstyle $$...$$ (or $...$) math expression:

• In displaystyle math mode, everything after the \] is flushed to the next paragraph, including punctuation. So, to have punctuation contained with the displayed equation, just include it as you would normally within text. Here's an example:

This is some paragraph text, and you can see that
$a^2+b^2=c^2.$
Here is the next paragraph.


Although I added some whitespace to accentuate the displaystyle math format, this is not really necessary. That is, the following example will produce the same result:

This is more paragraph text, and you can see that $a^2+b^2=c^2.$ Here is the next paragraph.


However, even though the output is perhaps the main purpose of a (La)TeX project, readability of code adds to its longevity.

• In textstyle math you can do the same as above, although it is better to use:

This is some paragraph text, and you can see that $a^2+b^2=c^2$.
Here is the next sentence.


If you do want displaystyle math in textstyle math mode, then you can force that using:

This is some paragraph text, and you can see that $\displaystyle\sum S_i$.
Here is the next sentence.


Note, however, that your interline spacing will be off. Or, even if it is maintained, there may be some overlap with symbols that are extensible in displaystyle math mode.

-