Including other .org files is quite easy. For example, for configuration,
#+setupfile: /path/to/config.org
or
#INCLUDE: /path/to/config.org
Those lines need to be in the .org file in order to be processed.
How could one have a given #+setupfile
and #+include
file available programmatically at export time, without having to insert them in the file?
Practical use case: we need to batch process several hundreds org-mode files from a read-only repository. Those files do not have any #+setupfile
and #+include
file. For example, we need to make available a few #+MACRO
lines (see below).
For each org-mode file, I could read it in a buffer, inject the needed #+setupfile
and #+include
, export the file, and go to the next.
Is there a simpler way, like for example setting #+setupfile
or #+include
as variables, so that they are automatically available at export time?
Perhaps there is a way to add something to .dir-locals.el
?
We even though of using some elisp within org-load-hook
or org-mode-hook
, but I could not find a way to pass content that needs to be evaluated as active Org-mode.
Just to give an idea, this is a much simplified #+SETUPFILE
:
#+OPTIONS: H:1 num:nil author:nil creator:nil timestamp:nil email:nil toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:nil skip:nil d:t tags:not-in-toc
#+MACRO: fleuron @@latex:\fleuron@@ @@html:<center>* * *</center>@@
#+MACRO: newline @@latex:\\@@ @@html:<br>@@ @@ascii:|@@
#+LATEX_CLASS: book
#+LATEX_CLASS_OPTIONS: [a4paper,twoside,onecolumn]
#+LATEX_HEADER: \bibliographystyle{plain}
#+LATEX_HEADER: \bibliography{bibliography}
org-publish-project-alist
- maybe you could bind it repeatedly to different, dynamically constructed projects, or just create one large list of projects?org-publish-project-alist
properties.ox
starts parsing the file. See the comment at the heading;;; Core functions
inox.el
.:setupfile
inorg-publish-project-alist
(see comments): emacs.stackexchange.com/questions/16623