1

I use setupfile to export org file to pdf. It basically define latex header and footer (my letterhead template). I include it in every org document like this

 #+SETUPFILE: c:/SETUPFILE

Though there is not much issue with this practice, but is it possible to define it in init to be automatically included in all org files for export

Vaibhav
  • 573
  • 3
  • 15
  • Not exactly what you are asking for, but you can use one of the many templating mechanisms in emacs to do that whenever you create an org file. See e.g. https://www.emacswiki.org/emacs/CategoryTemplates - the simplest is probably `auto-insert-mode` - do `C-h f auto-insert-mode` for more details. – NickD Apr 07 '21 at 12:10
  • SETUPFILE is interpeted when it seen: it does not set e.g. a variable that is used later, so I believe the answer is no: you cannot arrange for every file to use it except by explicitly requesting it. @Tyler's answer will take care of the particular case where you want to include LaTeX code, but in general, you have to add it explicitly (although as I said in my previous comment, you can automated the explicit insertion through a template mechanism). – NickD May 09 '21 at 23:45

1 Answers1

1

You could turn your SETUPFILE into a LaTeX class .sty file, and install that .sty file where LaTeX will find it. Then you can add your new package to the list of packages org automatically includes everytime you export to pdf by customizing the variable org-latex-packages-alist.

Tyler
  • 21,719
  • 1
  • 52
  • 92