3

I would like to export my org file to a different directory than the one containing the base org file. I've tried setting the property EXPORT_FILE_NAME:

:PROPERTIES:
:EXPORT_FILE_NAME: ./export/test
:END:

When I export the subtree that has this property drawer attached with C-c C-e l p, I'm seeing the following (surprising) behavior.

The .tex file is produced in ./export, as desired. The `.pdf' file is produced in the original directory.

How can I get both the .tex and the .pdf to show up in the other directory?

Here's a MWE of my org file:

#+TITLE: latex org-mode testing

* Exporting to different directory
:PROPERTIES:
:EXPORT_FILE_NAME: ./export/test
:END:

This is the material in the test file.
3

It turns out that the problem is with the way the latex compiler is called. Its own working directory is the original directory of the .org file, not the new directory of the .tex file. So that means that while it finds the .tex file in the correct directory (/export), its own working directory is still ./, so that's where it puts the output files. I had to explicitly specify the output directory. Adding the option -output-directory=%o to the command org-latex-pdf-process solved the problem.

  • 2
    Bernhard can you maybe share some configuration code for the emacs noobs like me? – Alwyn Schoeman Mar 6 at 14:55

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.