Update org-format-latex-options when theme changes

This commit is contained in:
Henrik Lissner 2018-06-03 12:23:17 +02:00
parent f9be8887fb
commit 3d893ea53e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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))
org-format-latex-options
(plist-put org-format-latex-options ;; Previews are usually rendered with light backgrounds, so ensure their
:background (face-attribute (or (cadr (assq 'default face-remapping-alist)) ;; background (and foreground) match the current theme.
'default) (defun +org|update-latex-faces ()
:background nil t))) (setq-default
org-format-latex-options
(plist-put org-format-latex-options
:background
(face-attribute (or (cadr (assq 'default face-remapping-alist))
'default)
: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