Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When using orgmode in Emacs, when I publish to HTML it uses a default CSS which doesn't look very nice.

After publishing, I manually jank out the old CSS for a custom one.

Is there a way in Emacs to make it use my other CSS file per default?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Use the :style parameter in your publishing project. For example:

(setq org-publish-project-alist
      '(("Homepage"
     :base-directory "~/git/homepage/"
     :base-extension "org"
     :publishing-directory "~/public_html/"
     :publishing-function org-publish-org-to-html
     :style "<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />")))

You can also define a per-file option like this:

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

Do C-h v org-export-html-style TAB TAB to list various options related to the style for HTML export.

share|improve this answer
    
Is it possible to have the CSS embedded (like the emacs default css is also embedded)? –  reinier Jun 1 '12 at 12:03
    
to answer my own comment: yes it is possible: just enter <style> ..css styles.. </style> where now the link to the external style sheet is given –  reinier Jun 1 '12 at 15:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.