Emacs Org-mode - Export to another directory?

tmilktoast picture tmilktoast · Mar 5, 2012 · Viewed 7.4k times · Source

I know this is kind of minor, but it's been bugging me. I'm using Org-mode for a project and I tend to export to either PDF or HTML rather frequently and it leaves my directory littered with PDF, Tex, and HTML files. Is there a way to have Org-mode export to another location, perhaps a subdirectory called ./exports?

Answer

cm2 picture cm2 · Mar 5, 2012

In addition to the use of publishing by modifying your org-publish-project-alist variable as @user1248256 suggested, you can directly specify the org-export-publishing-directory variable within your file:

#+bind: org-export-publishing-directory "./exports"

* This is a test headline
Some text here.  This should be exported to the "./exports" directory.

Upon export it will be placed in the "exports" directory, but only if that directory exists. If it does not exist, you will get an error message in the console.