On 3/16/25 8:02 PM, Ihor Radchenko wrote:
gynamics <dybfys...@163.com> writes:

Emacs has support frame background transparency since 29, add `:mask
heuristic` to overlay property list to make its transparent part masked
when displayed in a transparent frame.

There is a related thread
[[https://emacs-china.org/t/org-latex-preview-png/29167/12]] .

This is my first time to try to contribute, if I have anything done
wrong, please tell me!
Thanks for the patch!

Do I understand correctly that the problem you are trying to solve is
making LaTeX preview background transparent when your Emacs frame has
'alpha-background set to be transparent?

By default, Org mode indeed keeps the LaTeX preview background matching
background color of 'default face, without accounting for the frame
transparency.

However, you can also set :background in `org-format-latex-options' to
"Transparent". Did you try it?

Generating transparent background from the very beginning should be more
robust compared to :mask heuristics.

Do I understand correctly that the problem you are trying to solve is
making LaTeX preview background transparent when your Emacs frame has
'alpha-background set to be transparent?

Yes.

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.


Reply via email to