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


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

  • 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. emacswiki.org/emacs/CategoryTemplates - the simplest is probably auto-insert-mode - do C-h f auto-insert-mode for more details.
    – NickD
    Apr 7, 2021 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 9, 2021 at 23:45

1 Answer 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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