I have a document with only several source code blocks that should be tangled. So the structure is:
# Some main.org
...
#+BEGIN_SRC awk :tangle file1.awk
...
#+END_SRC awk
...
...
#+BEGIN_SRC awk :tangle file2.awk
#+END_SRC
...
Firstly, I have noticed that just exporting main.org is not goint to trigger tangling. Then, I decided to add a call to (org-babel-tangle)
somewhere at the top of main.org. This call will produce file1.awk and file2.awk, but will also have an undesired side-effect of tangling the entire main.org file (#+INCLUDE
directives substituted with contents of the included files, macros substituted, ...) into, well, main.org. How to avoid this behavior and produce only the files intended for tangling?
C-c C-v t
tangles the current org-file. For the combination of tangling and exporting there exists already an answer: emacs.stackexchange.com/a/29472/2370. Whereas I am willing to re-treat my close-vote if you insinst on tangling by a command in the org-buffer. – Tobias Feb 21 '18 at 12:11