Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs Org-mode - Export to another directory?

Tags:

org-mode

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?

like image 467
tmilktoast Avatar asked Mar 04 '12 23:03

tmilktoast


People also ask

How do I export from Emacs?

To export your org file to a web page, type C-c C-e to start the exporter and then press h to select html and o to select open. A new web page should now open in your browser. Similarly, typing l and o in the exporter will convert the org file to latex and then compile it to produce a pdf and display that.

How do I use Emacs Org mode?

Emacs does not actually understand you are editing an Org document, yet. To enable Org mode on your current document, type M-x org-mode which will enable the Org mode on the current document. Those are minuses, not underscores.

Is org mode built in Emacs?

Emacs has included Org Mode as a major mode by default since 2006. Bastien Guerry is the current maintainer, in cooperation with an active development community. Since its success in Emacs, some other systems now provide functions to work with org files.


1 Answers

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.

like image 60
cm2 Avatar answered Dec 31 '22 18:12

cm2