# How to best format the question mark that immediately follows an equation in a question sentence?

Searching for "punctuation after equation" didn't turn up anything here so I'll post this as a new question.

This question (on a different site) in its entirety:

I was wondering where does the formula for redshift $$z=\frac vc$$ come from? Can it be derived from the definition of redshift $$z={\lambda_{observed} - \lambda_{emitted}\over \lambda_{emitted}}$$ ?

Question: In Math SE proper how do you recommend people end a sentence that contains an equation just before the final punctuation, especially if that punctuation is a question mark?

To some (including me) the proximity of the question mark to the equation can make it look like it's not a sentence, but that the equation itself is questionable, or that there is a missing variable or expression that's been replaced with a question mark (i.e. "something goes here, but I don't know what").

As another example, I just wrote the comment:

There was a typo in my third equation, it should read $$i_{sup} = I k + J (-l).$$ Does that change your $$B$$ to $$B = \begin{pmatrix} \frac{7}{2} & +1 \\ \frac{\sqrt{3}}{2} & 2\sqrt{3} \\ \end{pmatrix}?$$

• Having a question mark opening a line, as in the example, is definitely not what you want to do. A solution I've seen usually is to rephrase things: "... from the definition of redshift ($*$)?" And then say something like "Recall that redshift is given by the equation below: ($*$) ..." Mar 1, 2020 at 1:49
• The question mark (or any other punctuation) goes in the displayed equation, e.g. Is it true that $$f''(x) = \lim_{h\to 0} \frac{f(x+h) + f(x-h) -2f(x)}{h^2}?$$
– Xander Henderson Mod
Mar 1, 2020 at 3:20
• I agree with @XanderHenderson. The punctuation following an equation is most often a period or comma. But other punctuation is done in the same way. But (of course) some wise guy will take a formula followed by a '!' and claim to confuse it with a factorial. Mar 1, 2020 at 13:14
• I would opt to change the question to read: Can it be derived from the following definition of redshift ? $$z={\lambda_{observed} - \lambda_{emitted}\over \lambda_{emitted}}$$ Mar 2, 2020 at 11:09
• @lioness99a properly your question-mark there should be a colon (:) with the question mark coming after the equation still. The word "following" makes the colon almost mandatory :) Mar 2, 2020 at 11:33
• @GEdgar No one in any math.se question should be using a "!" unless it is to denote the factorial. (!) Mar 2, 2020 at 15:16
• @amWhy Except that a large portion of math.se posts might be rewritten as "Do my homework!" - More seriously, even a polite problem statement is commonly given in imperative form and should therefore properly end in an exclamation mark. Fortunately, nobody obeys that rule, or we might face "Show that $3!=6$!" Mar 8, 2020 at 18:13
• @Hagen Well, that is a great weakness on this site. Anyway, I said "any math.se question" should end in a question mark (not any math.se post). Just because someone posts an imperative doesn't make it a question, just as if someone comments, asks for clarification, rants, says thank you, etc in an answer post, that doesn't make it an "answer". But I get what you're saying. Mar 8, 2020 at 18:16
• In my version of English, at least, imperative sentences should rarely if ever end in an exclamation point. Mar 12, 2020 at 19:45
• I think your problem is that you write two dollar signs instead of one ($$instead of ). When you use two dollar signs, your equation will go to the next line; but when using one, the equation will remain in the line. Mar 14, 2020 at 10:56 • @aminabzz I have no problem, I have a question. In Stack Exchange we can write Mathjax equations with either inline or display style within a sentence but this doesn't matter here. My question is about the punctuation at the end of that sentence. – uhoh Mar 14, 2020 at 12:16 ## 3 Answers As far as I know, math SE does not have a formal style guide so (as the comments to your question indicate) there is no one correct answer to where the punctuation should go. If the correctness is your main concern then I would suggest consulting a style guide and, should anyone then question your decision, you can point them to the style guide as your authority. A quick websearch turned up the IEEE styleguide and the SIAM styleguide. Neither of these directly addresses the issue of the query-mark $$?$$ but you can deduce from the remarks on commas (pp$$20-21$$ for IEEE and $$\S12.4.5$$, pp73-74 of the SIAM guide) that the query-mark should go at the end of the equation. Generally speaking you shouldn't put punctuation marks on their own ('orphan'ing them) as it disrupts the reading process and breaks the reader's concentration to encounter the mark in isolation. Where is there is a risk of ambiguity by including the punctuation mark (one commentor mentions that the exclamation mark might be (deliberately) confused with the factorial symbol you can enclose the punctuation in parenthesis (e.g. $$(?)$$) or change the weight of the symbol (embolding it) to provide a clear distinction. If neither of those work then consider separating the question and the expression/equation altogether. The aim of mathematical writing should be clarity, and for websites, where space is not at a premium, making use of that space is preferable to being ambiguous but concise. • When I use display mode, followed by a question, I also tend to provide space between the end of the formula, and the question mark. E.g. "How do I solve$$\text{this integral} \quad ?" Mar 2, 2020 at 15:18
• When I type an equation in display mode that should have a period after it I usually omit the period altogether. I'm not at all sure that is correct, but I feel like the display mode carries a break with it and I can't find a place to put the period that I am happy with. I don't remember wanting another punctuation mark, so the question has not arisen. Mar 4, 2020 at 3:36

For me the allowed punctuations at the end of a displayed equation are $$[{\rm no\ punctuation}]\qquad.\qquad,\qquad;\qquad\square\qquad,$$ where $$\square$$ is a widely used sign for $$\langle$$q.e.d.$$\rangle$$ . In the example of the OP one could easily write

I was wondering where does the formula for redshift $$z=\frac vc$$ come from. Can it be derived from the definition $$z={\lambda_{observed} - \lambda_{emitted}\over \lambda_{emitted}}$$ of redshift?

I believe that the most elegant solution of the problem is @ChristianBlatter’s, namely to convert a direct question, such as “Who are you?” to an indirect question: “I’d like to know who you are.” Note that a direct question is an interrogative sentence and takes the question mark, while an indirect question is (usually) declarative, and properly takes no question mark (and does not invert the word order).