Hi Timothy, Thanks again for your work on this exciting feature! I tried out your new code and it does indeed fix the problem on Emacs 29. But then I remembered that I originally encountered the issue on Emacs 28, and sure enough the issue persists there. To summarize, to get it to look right on Emacs 28, you need to append the face spec '(:inherit default :extend t) to the list of faces, rather than just 'default. Otherwise, when an equation overlay wraps to the next line in visual-line-mode, you'll see the background color of the org-block face leak through after the end-of-line. Emacs 29 appears to behave more sensibly: if the overlay wraps to the next line, its face is not applied to the end of the current line. I'm attaching a screenshot of the problem, showing the grey blocks at the end of the first two lines. The second screenshot is after applying this patch, which sets the :extend face attribute: https://github.com/roshanshariff/org-mode/commit/latex-preview-face-extend. Regards, Roshan On Sun, 7 Jan 2024 at 00:28, Timothy wrote: > > Hi Roshan, > > > This change addresses two issues: > > > > 1. Latex previews in headings have the background color of the > > fontified Latex code, rather than the rest of the heading. > > > > 2. If Latex code is fontified with a face that has the :extend > > attribute, and the preview overlay wraps to the next line, then the > > empty space after the end of the line uses the background color of the > > Latex code rather than that of the surrounding text. > > Sorry for the delay in getting back to you. I ended up being rather busy around > the middle of last year. I’ve just started another sprint on the LaTeX preview > rewrite, and have made a few changes to how face guessing heuristics. > > If you might be willing to try the new code and see if the issue noticed still > appears, that would be brilliant! > > All the best, > Timothy > > -- > Timothy (‘tecosaur’/‘TEC’), Org mode contributor. > Learn more about Org mode at . > Support Org development at , > or support my work at .