As a follow up to this question: superuser question 431356

How can I specify org mode publish setting globally? So not per project, but for any .org file I happen to publish?

so instead of:

 (setq org-publish-project-alist
  :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\" />")))

or this for every file:

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

I want something that changes the defaults of any org file.


You can customize org-export-html-style and org-export-html-style-extra.

The first has all the default values for org export, so you'd better leave as is unless you want to override everything.

org-export-html-style-extra gets appended after the default style definition with your own variations.

I use this setting:

"<style type=\"text/css\">\n  html {\n  font-family: sans-serif;\n  font-size: 11pt;\n  }\n  em { font-style: normal; font-weight: bold;}\n</style>"
  • GREAT! That was the trick! – reinier Jun 1 '12 at 20:31

Juancho's answer worked for me, with one change: when going through the org-mode customization menu (Customize > Export > HTML > Style Extras) I had to remove the \n and escape characters.

  • 1
    This should really be a comment to the top answer. – reinier Jul 11 '12 at 19:52
  • Agreed, but I don't see an "Add comment" by the top answer. – Tom Slee Jul 13 '12 at 12:06
  • ah perhaps you don't have enough reputation points to post a comment. (I think you have to have a few hundred points (their way to fight spam)) – reinier Jul 15 '12 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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