How to change the foreground/background colors of LaTeX equations exported to svg using dvisvgm? #612
-
This discussion is created from #611 by @Perangelot. Actual BehaviorUsing the option The svg images are, unlike the usual Expected BehaviorHave customizable variables governing the foreground and background colors of the images. How to Reproduce the IssueTry this MWE:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I am afraid this is out of my expertise. Also, this wouldn't be something specific to ox-hugo. You should be getting the same colors whether you exported using ox-html or any other backend. If you can figure out how to export with custom colors using ox-html, the same would work for ox-hugo as well. Trying asking this question on customizing dvisvgm image background and foreground colors on the Org mode mailing list. If you find out how to do that, let me know in comments so that it gets documented for other users. |
Beta Was this translation helpful? Give feedback.
-
I looked around in the Org manual and I found this node (org) Previewing LaTeX fragments -- There a variable Upon doing
The relevant pieces are:
Default LaTeX -> dvisvgm -> SVG foreground/backgroundFrom https://ox-hugo.scripter.co/test/posts/equations-exported-to-svg/, the equations show up in black foreground with transparent background by default: SVG foreground/background after customizationIf you evaluate this: (with-eval-after-load 'org
(plist-put org-format-latex-options :html-foreground "Yellow")
(plist-put org-format-latex-options :html-background "Blue")) you will get: Yes, it's not pretty -- I am just demonstrating the customization of SVG foreground/background. PS: The fonts are different because this second screenshot is from my localhost server where the default font type happens to be Serif. |
Beta Was this translation helpful? Give feedback.
@Perangelot
I looked around in the Org manual and I found this node (org) Previewing LaTeX fragments -- There a variable
org-format-latex-options
is documented.Upon doing
C-h v org-format-latex-options
, you will see: