gynamics <dybfys...@163.com> writes:

>> However, you can also set :background in `org-format-latex-options' to
>> "Transparent". Did you try it?
>
> Yes, I have reviewed related code and tried it.  Set `:background 
> "Transparent"` in `org-format-latex-option` only makes sure that latex 
> will output png images with a transparent background. But to display the 
> transparent part transparently when my Emacs frame has 
> `alpha-background` set to be transparent, currently `:mask heuristic` 
> seems to be the only way, afaik.

According to my bug#77104 report to Emacs 
(https://yhetil.org/emacs-bugs/87h63q9pxw.fsf@localhost/)
the problem with transparency is indeed an Emacs bug.

However, I am afraid that :mask heuristic will do more harm than benefit
to be applied Org upstream. Specifically, I am afraid that :mask
heuristic may cause ugly rendering when image file happens to _not_ have
background color in the corners. So, while solving your specific issue,
we may introduce another issue for _more_ users.

Thus, I am canceling this patch.
Canceled.

After bug#77104 is fixed, you should be able to setup transparency to
achieve what you need.

Meanwhile, I can only suggest adding an advise to
`org--make-preview-overlay' to apply :mask heuristics.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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/yantar92>

Reply via email to