emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] Fix background color of latex previews


From: Roshan Shariff
Subject: Re: [PATCH v2] Fix background color of latex previews
Date: Sun, 7 Jan 2024 02:50:12 -0700

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 <orgmode@tec.tecosaur.net> 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 <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/tec>.

Attachment: with-bug.png
Description: PNG image

Attachment: correct-appearance.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]