n.goaz...@gmail.com writes:

> Hello,
>
> Alan Schmitt <alan.schm...@polytechnique.org> writes:
>
>> 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:
>>
>> #+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
>>
>> 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?
>
> I think this has to do with ":exports none", which means that code will
> not be evaluated during export. You may want to try setting the
> attribute to some other value, and put the block in a :noexport: entry.

Thanks a lot, this was it.

Alan

Reply via email to