Improved compatibility with LaTeX math mode

Bracket highlighting should now work in all LaTeX math environments. Previously, it was not working with simple TeX style math delimited by $...$ or $$...$$.