By default, MathJax does not use the single dollar as a delimiter for in-line math (for exactly the reason you indicate), and so your configuration must be explicitly enabling it. See the text2jax dpcumentation for details of how this is done.
You have several options:
Remove the configuration that turns on dollar signs for in-line math. (This won't be good if you have already used them for in-line math in other posts)
Enable the
processEscapes
option so that you can use\$
to get a dollar without it being used as a math delimiterIf your blog allows you to enter raw HTML, you could use
<span>$</span>
to prevent MathJax from using the dollar as a delimiter (math can't contain HTML tags, so this dollar will not match up with another one, so won't be used as a delimiter).Put your code examples inside
<pre>
or<code>
containers, as MathJax (at least by default) doesn't process math within these. Your configuration may have changed that, however, so check theskipTags
setting in your configuration.
Any of these should allow you to do what you need.