Hello,

I would like to inline a css when exporting a file to html, but I don't
know how to tell org-mode to set the variable org-html-head from within
the file.

Here is what I tried: I added the following block at the beginning of my
file:

--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC emacs-lisp :exports none
  (set (make-local-variable 'org-html-head) (concat
                             "<style type=\"text/css\">\n"
                             "<!--/*--><![CDATA[/*><!--*/\n"
                             (with-temp-buffer
                               (insert-file-contents "style.css")
                               (buffer-string))
                             "/*]]>*/-->\n"
                             "</style>\n"))
#+END_SRC
--8<---------------cut here---------------end--------------->8---

It does not seem to be evaluated, however.

Is there a way to have arbitrary code stored in the file being exported
being evaluated before an export?

Thanks,

Alan

Reply via email to