Cannot get emacs org-mode to use my CSS file

I'm having trouble getting org-mode emacs to export using my CSS file. I searched all day, but can't get it to work. The .org file and .css are in the same directory, and my .org file has the following:

#+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" /> * First Headline... * Second Headline... 

However, when I export to HTML and view it in my browser, no changes occur. Looking at the source, it also shows that the standard org-mode HTML header was used. Any suggestions?

+4
source share
2 answers

I do not see a link to the STYLE parameter that you are using. The closest thing I find in the org manual relates to HTML_HEAD and HTML_HEAD_EXTRA :

Each exported file contains a compact default style that defines these classes basically (2). You can overwrite these settings or add the org-html-head' and org-html-head-extra' variables to them. You can override the global values โ€‹โ€‹of these variables for each file with the following keywords:

  #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style1.css" /> #+HTML_HEAD_EXTRA: <link rel="alternate stylesheet" type="text/css" href="style2.css" /> 

My version of org is 8.0.2.

+2
source

Try #+STYLE: instead of #+HTML_HEAD: It worked for me.

-1
source

Source: https://habr.com/ru/post/1479840/


All Articles