Perry Smith <[email protected]> writes: > From my experimentation, it appears that how exporting (at least > during “publishing” is far different than I thought. So, the essence > of my question is, where are macros suppose to be defined? I assumed I > could define them once before they were used and then use them > anywhere but that doesn’t seem to be the case.
You can define global macros in org-export-global-macros. See (info "(Org)Macro Replacement") / https://orgmode.org/manual/Macro-Replacement.html Macros defined with =#+MACRO:= keywords are defined for that document. Org-publish will not remember them for other files. Inclusion is done before macro expansion and should work, so my guess is that in some file you're trying to invoke a macro that hasn't been included in that file (see reply to Paul downthread). You can also place macros in one or more separate "setup files", which can live outside the publishing directory, and include them with =#+SETUPFILE: <path/to/setupfile>= in each document. This is really the suggested approach for including in-buffer settings like export options, though INCLUDE works much the same. See (info "(Org)Export Settings") / https://orgmode.org/manual/Export-Settings.html Whichever way you include them, your macro definitions can live in files outside the publishing directory, or you can exclude the files containing them with =:exclude <regexp>= in org-publish-project-alist. Regards, Christian
