I think I have done something like this with tags and custom export lisp code.
Something like: (let ((org-export-exclude-tags '("supplementary" "noexport"))) (org-export-as-latex 5)) That allows me to export all sections not tagged by those values. This would require all your code blocks be in tagged sections, e.g. tagged by "internal", "external", etc... for a particular org file I make an init.el file with different export functions in it. Alternatively, I have put emacs-lisp code blocks in the org file so it is self contained. I am curious what other people do. My typical uses for selective export are to selectively export a manuscript from an org file, or to separately export a homework and the solution from one file. -- ================================== John Kitchin Associate Professor A207F Doherty Hall Department of Chemical Engineering Carnegie Mellon University 412-268-7803