2

I have a bunch of org-mode files in a directory structure and would like to export to html using org-publish. Not all of them have the #+SETUPFILE: header, and I'd like to avoid having to add that in to every file.

So how do you add the line

#+SETUPFILE: /path/to/my/setupfile.setup

to every org file when org-publish is invoked (especially when a #+SETUPFILE: header is not already present?)

JP.
  • 131
  • 5
  • "... I'd like to avoid adding that to every file": Why? If it is needed, why *not* add it to every file? – NickD Jun 04 '21 at 17:33
  • 2
    Does this answer your question? [How to include other .org files programmatically (ie not from main .org file)?](https://emacs.stackexchange.com/questions/7438/how-to-include-other-org-files-programmatically-ie-not-from-main-org-file) – volent Mar 28 '22 at 13:01
  • It probably does, but I think it is overly complicated due to that post needing an #+INCLUDE tag. I'll post the solution I found at the time below. – JP. Apr 24 '22 at 17:19

1 Answers1

1

It turns out there is a org-mode variable specifically aimed at providing a header. See the documentation for the emacs variable org-html-head. For my particular case, I put the contents of the orgexp.setup file into the variable.

This is the relevant snippet from my .emacs file:

(setq org-html-head-include-default-style nil)

(setq org-html-head "
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/css/htmlize.css\"/>
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/css/bigblow.css\"/>
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/css/hideshow.css\"/>

<script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/js/jquery-1.11.0.min.js\"></script>
<script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/js/jquery-ui-1.10.2.min.js\"></script>

<script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/js/jquery.localscroll-min.js\"></script>
<script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/js/jquery.scrollTo-1.4.3.1-min.js\"></script>
<script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/js/jquery.zclip.min.js\"></script>
<script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/js/bigblow.js\"></script>
<script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/bigblow_theme/js/hideshow.js\"></script>
<script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js\"></script>
"
)

Hope that helps someone else out there.

JP.
  • 131
  • 5