I have a tex file containing lots of standard settings such as packages to be included and various other options. How do I tell Org mode to use only the settings from that TeX file?

i.e. for all practical purposes, the org-document should only export to a tex file the part between \begin{document}...\end{document} whereas the other document settings such as what documentclass and packages to use are borrowed directly from the .tex file. By default Org creates the preamble like



which I don't want

  • Is the export supposed to end up in that file? Or is the tex file supposed to be included in the output file? Not sure it can be done in any case, but we might as well get clarity on the desired outcome. – NickD Nov 20 '18 at 1:17

You need to add your own preamble to org-latex-classes and you also can exclude the default packages from beeing loaded (see the description of that variable).

The following works for me. Put

(add-to-list 'org-latex-classes

somewhere to your org config. Then an org-file like

 #+TITLE: test
 #+AUTHOR: My name
 #+LaTeX_CLASS: my-org-latex-class

 * Introduction
   Intro text 

produces a tex-file without the default packages. If you are not using the package hyperref you also might want to set the variable org-latex-with-hyperref to nil.

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.