I use many org files with figures generated by source code blocks.
By example, in an org mode file long/path/document.org I have:
#+BEGIN_SRC dot :file my_fig.png :exports results
digraph {
A->B
B->C
C->A
}
#+END_SRC
However, to keep a clean directory/files hierarchy I want store the generated figures (or data) in a subdirectory associated to each org mode document, for instance: long/path/document-extra/my_fig.png.
#+BEGIN_SRC dot :file long/path/document-extra/my_fig.png :exports results
digraph {
A->B
B->C
C->A
}
#+END_SRC
Doing that manually is tedious, how to automate this?