org-macros
org-macros copied to clipboard
Macros not recognized when narrowed-subtrees are exported
Consider an org-file structured as follows:
Main Heading
Sub-heading 1
Sub-heading 2
....
Sub-heading N
If I define include the macro setup-file at the head of the org-file, and then try to export a narrowed subtree, I get an error saying 'macro not defined'. However, the export works perfectly if I include the macro set-up file in the narrowed subtree.
Typical set-up files (say defining CSS styling) don't seem to have this problem.
Could you let me know if this has a solution?
Hello @pj-paul. I don't have any answer out of the box for this.
What does happen if you put the macros "inlined" (instead of sourcing them via an include file) at the head of the org-file? Does that work?
Anyhow, you should report this behavior to the Org mode mailing list.
PS- Do you have extra macros you'd think would be worth adding for the community?
@fniessen Thanks for the response.
-
Inlining macros at the head of the org-file works. The narrowed sub-tree exports without errors.
-
Will ask on org-mode mailing list + Stack-exchange.
-
Hmmm, not sure if I have anything to add that's not currently covered. One suggestion would be to allow wrapping selected text/ region inside the macro statement. So, something like auto-wrapping for parentheses (see here), but for macros.
On 3, I found this article on chaining macros. Maybe this might inspire some ideas for you. :)