12

I know that when writing a displayed equation, it's correct to write punctuation before the closing \] as follows:

This proves \[ x^2 = 3, \] and it follows that \[ x = \pm\sqrt{3}. \]

If I'm using a cases environment, where's the correct place for the period to end the sentence?

Absolute value is defined as \[ \lvert x \rvert = \begin{cases}
  x & \text{if $x \ge 0$} \\
  -x & \text{if $x < 0$}
\end{cases} \]

If I put it after the cases environment, it looks funny. If I leave it off completely, then it also looks bad. It looks okay to put it at the end of the second line ($x < 0$.}), but are there any better solutions?

David Carlisle
  • 757,742
Sophie Alpert
  • 15,550
  • 9
  • 37
  • 37

2 Answers2

9

You've pretty much enumerated all the sensible options in your question, so I don't know that there's anything else. What I've seen sometimes (IIRC) is to put a comma after each case, and then I guess the period could go at the end of the last one.

David Z
  • 12,084
  • 7
  • 48
  • 65
3

This is what I would do:

Absolute value is defined as:
%
\[
\left\lvert x \right\rvert \coloneqq
 \begin{cases}
  x & \text{if } x \ge 0 \\
 -x & \text{if } x < 0
 \end{cases}
\]

Thus: a colon introducing the maths, and no punctuation afterwards. My reasoning is in my answer to ... err ... I thought we had a question on punctuation after maths here? What happened to it? Nonetheless, it was asked over on MathOverflow so I can cite it as this answer instead.

My basic point is that anyone reading more than a few symbols will need to stop "reading English" and switch to "reading maths" and that this mental switch has the same effect as a full stop. Of course, you can punctuate internally to the maths since punctuation still has meaning, but it should be read as being internal to the mathematics and not refer to the external text. Thus David's suggestion in his last sentence (at time of writing) makes sense to me.

Those that find the absence of a full stop abhorrent (there are some, as can be seen by looking at the comments to my answer on MO) can adjust the preceding remark to make it a full sentence, or to make it clearer that it isn't. Thus:

Absolute value is defined as in the following formula.
%
\[
\left\lvert x \right\rvert \coloneqq
 \begin{cases}
  x & \text{if } x \ge 0 \\
 -x & \text{if } x < 0
\end{cases}
\]

(You may notice that I've also introduced a couple of other stylistic "improvements"!)

David Carlisle
  • 757,742
Andrew Stacey
  • 153,724
  • 43
  • 389
  • 751
  • One of your stylistic improvements I don't see the rationale for: why the %? – Mark Meckes Jul 29 '10 at 13:55
  • @Mark Meckes: not all my improvements are aimed at the end product. In that case, putting in the % clearly separates the mathematics from the running text, making it easier to spot in the source file. Thus the rationale is to make life easier on yourself. A good rule of thumb is to make life easier on the you reading the source file in 12 months' time when you get the referee's report after having forgotten all about that paper in the meantime. – Andrew Stacey Jul 29 '10 at 14:17
  • Oh, I understand all that. I just would have thought that putting the \[ on a line by itself would achieve that end just fine. Maybe I'll try adding blank comment lines and see whether it really does make it easier to spot the math. – Mark Meckes Jul 29 '10 at 14:54
  • @Mark Meckes: horses for courses ... I think I started putting %s everywhere when I didn't have justification properly configured in emacs and not putting them on risked the fill command pulling the maths into the paragraph. Now that I'm used to it, I prefer it. If I have a really long bit of inline maths then I'll put it on its own line separated by %s as well. In one paper, I get up to about 400 lines consisting of just '%'. – Andrew Stacey Jul 29 '10 at 15:22
  • "If I have a really long bit of inline maths then I'll put it on its own line separated by %s as well." Now that's a really good idea I hadn't thought of. – Mark Meckes Jul 29 '10 at 15:34
  • @Mark Meckes: that idea came from when I was converting to a DVCS. I wanted the output of diff to actually mean something so had to think "If this bit changes, what of the surrounding text should diff show?"; then that gets put on the same line. So sentences correspond to lines, and big complicated bits of (inline) maths also correspond to a line since I'll not be interested in the surrounding text. More at http://www.math.ntnu.no/~stacey/HowDidIDoThat/LaTeX/versioning.html – Andrew Stacey Jul 29 '10 at 18:05
  • Well, I may be too lazy ever to learn to use VC, but it's a good enough idea just for readability's sake. – Mark Meckes Jul 29 '10 at 18:20
  • 1
    @Mark Meckes: I'm too lazy not to use VC! – Andrew Stacey Jul 29 '10 at 18:28
  • There's a subtle but important distinction here: you say you're too lazy not to use VC, but I think I may be too lazy to learn to use VC. – Mark Meckes Jul 29 '10 at 19:14
  • Why'd you change the \text{} command? I'd learned that it's more correct to do it the way that I did. – Sophie Alpert Jul 30 '10 at 03:49
  • Knuth's Mathematical Writing says not to use colons like this. There's a great comment in there about some mathematical writing containing more colons than periods. – TH. Sep 16 '10 at 13:11
  • 3
    @TH., @Andrew Stacey: There is another great comment in Knuth's Mathematical Writing, which says "Many readers will skim over formulas on their first reading of your exposition. Therefore, your sentences should flow smoothly when all but the simplest formulas are replaced by `\blah' or some other grunting noise." For me, this is a very good reason to always use proper punctuation at the end of displayed formulas. – Hendrik Vogt Oct 23 '10 at 08:37
  • @Hendrik: One could argue this for hours! I would say that for displayed maths then the formulas are replaced by "Big Blah!" and the brain does at least pause when it sees a huge equation - long enough for the equation to be equivalent to a full stop. Less prosaically, a grunt is actually a form of punctuation in itself! – Andrew Stacey Oct 23 '10 at 15:32