The problem is compounded by the following facts:
There are different style sheets for different disciplines and even subdisciplines that use mathematics. For example, do you put a punctuation mark that happens to follow a quoted item inside or outside the quotation marks? Once upon a time, it was a universal rule, so far as I know, to put the punctuation inside, but computer folk began to depart from this convention due to the importance of exact quotation in formal languages and full-text searching.
Different implementations of TeX and its kin, by design or oversight, force different choices with respect to: $\operatorname{Blah}, \operatorname{Blah},$ on the one hand, and $\operatorname{Blah}, \operatorname{Blah}$, on the other hand, at least, if you want to avoid the risk of having a punctuation badly split to the next line every now and then.

