# LaTeX highlighting: Dollar expressions across lines

I'm having some trouble with LaTeX math expressions between (single) dollar signs. Specifically, syntax highlighting breaks across lines. Things looks something like this:

if there exists $\alpha<\kappa$ and a map $f:X\setminus\alpha\to Y$. Then let $X,Y$ be subsets...

where I'm using boldface to indicate highlighting. It should be displayed like this:

if there exists $\alpha<\kappa$ and a map $f:X\setminus\alpha\to Y$
. Then let $X,Y$ be subsets...

This was indeed the behavior in some previous version. I'm working now with GNU Emacs 24.3.1.

Is there some way to correct this?

• It works as expected for me sometimes, and others the problem is as you describe. This is with Emacs 25.2.2, emacs -Q. I think this might be a legitimate bug, rather than a problem with your configuration. – Tyler Jun 14 '17 at 16:06
• Not answering your question, if you write several LaTeX documents, you may have a look at AUCTeX ;-) – giordano Jun 14 '17 at 16:21
• My recollection is that the variable in tex-mode.el containing all of the regexp is several lines long, and the math regexp is somewhere in the middle. People tend to like small snippets as answers, whereas this one would likely entail posting the definition containing all of the regexp that are included in the variable. A multi-line regexp is fairly simple, but the answer wouldn't likely be tiny snippet. M-x find-variable RET tex-font-lock-keywords-1 RET – lawlist Jun 14 '17 at 16:25