In math mode when I type a sentence, my habit was to put commas/full stops/semicolons, etc. outside the dollar sign. For example, I would write Let the variable be denoted by $x$., instead of Let the variable be denoted by $x.$
But sometimes I need to place a formula in the centre by using double dollar sign and there is a problem. If I write By the formula $$e^{i\pi}+1=0$$, we have ..., then the comma will appear at the beginning the next line, which looks awkward. So I have to write By the formula $$e^{i\pi}+1=0,$$ we have ... instead.
My question is, do $x$, and $x,$ look exactly the same? If no, what should one do if s/he uses double dollar sign to centralize an expression but still prefers to place the comma outside of the dollar sign?



$x$.. BTW: unless you are using plain TeX, you should not be using$$...$$syntax as it does not follow the general LaTeX configuration. – daleif Nov 25 '14 at 09:26\[..\]in LaTeX rather than$$..$$. Ideally you should do$x$,and then you would need\[x\text{,}\]but since in Computer Modern they look almost (if not completely) identical, people tend to use\[x,\]which is, usually, not noticeable. – Manuel Nov 25 '14 at 09:27\[ ... \]preferable to$$ ... $$? – Mico Nov 25 '14 at 10:06