From 206ffa513edd3498fc2d80471e1b9e520610aa0c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 19 Oct 2016 16:56:51 -0700 Subject: [PATCH] [Emacs] Use theme background color in org-export --- dotfiles/emacs.d/README.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 36a3a184..8e38a3ad 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2982,6 +2982,26 @@ Intero seems to be causing hangs, so it has been disabled ;; blame. )) #+END_SRC +**** Correct BG color for org-export +#+BEGIN_SRC emacs-lisp +(use-package org + :config + (progn + (defun imalison:org-inline-css-hook (exporter) + "Insert custom inline css to automatically set the +background of code to whatever theme I'm using's background" + (when (eq exporter 'html) + (let* ((my-pre-bg (face-background 'default)) + (my-pre-fg (face-foreground 'default))) + (setq + org-html-head-extra + (concat + org-html-head-extra + (format "\n" + my-pre-bg my-pre-fg)))))) + + (add-hook 'org-export-before-processing-hook 'imalison:org-inline-css-hook))) +#+END_SRC **** org-projectile #+BEGIN_SRC emacs-lisp (imalison:use-package org-projectile