Say you have the following org-babel source block:
#+BEGIN_SRC latex :results raw :file test.pdf
\LaTeX
#+END_SRC
When executing it, org-babel will do the actual compilation in a temporary directory and move the resulting PDF back to your working directory afterwards. The problem with this is that I cannot include my local LaTeX commands and configuration with \input{myMacros}
, since it won't be found in the temporary directory.
How can I tell org-babel to execute a source block in the folder of the org-mode file (hence in the default-directory
)?
:dir
header argument can probably be used for this, see orgmode.org/manual/dir.html and org-babel.readthedocs.io/en/latest/header-args/#dir Example:#+header: :dir (format "%s" default-directory)
(Note: probably not working with justdefault-directory
). If this works I will post as answer.:dir
, the compilation still takes place in some temporary directory. Maybe this is a bug in org-mode 9.2.6?