Inline Math: Allow white spaces before closing dollar signs

I’ve just learned why whitespaces before closing $s are not allowed.

The MathJax Document says:

The default math delimiters are $...$ and \[...\] for displayed mathematics, and \(...\) for in-line mathematics. Note in particular that the $...$ in-line delimiters are not used by default. That is because dollar signs appear too often in non-mathematical settings, which could cause some text to be treated as mathematics unexpectedly. For example, with single-dollar delimiters, “… the cost is $2.50 for the first one, and $2.00 for each additional one …” would cause the phrase “2.50 for the first one, and” to be treated as mathematics since it falls between dollar signs. See the section on TeX and LaTeX Math Delimiters for more information on using dollar signs as delimiters.

Given this fact, it would be difficult to simulate ${}$ by $$ without causing any unexpected behavior. I personally recommend using the Latex Suite plugin to enter ${ }$ quickly. See the linked post below for the details: