Update org-format-latex-options when theme changes
This commit is contained in:
parent
f9be8887fb
commit
3d893ea53e
1 changed files with 14 additions and 9 deletions
|
@ -189,16 +189,21 @@ unfold to point on startup."
|
||||||
org-use-sub-superscripts '{}
|
org-use-sub-superscripts '{}
|
||||||
outline-blank-line t
|
outline-blank-line t
|
||||||
|
|
||||||
;; LaTeX previews are too small and usually render to light backgrounds, so
|
;; Scale up LaTeX previews a bit (default is too small)
|
||||||
;; this enlargens them and ensures their background (and foreground) match
|
|
||||||
;; the current theme.
|
|
||||||
org-preview-latex-image-directory (concat doom-cache-dir "org-latex/")
|
org-preview-latex-image-directory (concat doom-cache-dir "org-latex/")
|
||||||
org-format-latex-options (plist-put org-format-latex-options :scale 1.5)
|
org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
|
||||||
|
|
||||||
|
;; Previews are usually rendered with light backgrounds, so ensure their
|
||||||
|
;; background (and foreground) match the current theme.
|
||||||
|
(defun +org|update-latex-faces ()
|
||||||
|
(setq-default
|
||||||
org-format-latex-options
|
org-format-latex-options
|
||||||
(plist-put org-format-latex-options
|
(plist-put org-format-latex-options
|
||||||
:background (face-attribute (or (cadr (assq 'default face-remapping-alist))
|
:background
|
||||||
|
(face-attribute (or (cadr (assq 'default face-remapping-alist))
|
||||||
'default)
|
'default)
|
||||||
:background nil t)))
|
:background nil t))))
|
||||||
|
(add-hook 'doom-load-theme-hook #'+org|update-latex-faces)
|
||||||
|
|
||||||
;; Custom links
|
;; Custom links
|
||||||
(setq org-link-abbrev-alist
|
(setq org-link-abbrev-alist
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue