Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros not recognized when narrowed-subtrees are exported #7

Open
pj-paul opened this issue Oct 30, 2019 · 4 comments
Open

Macros not recognized when narrowed-subtrees are exported #7

pj-paul opened this issue Oct 30, 2019 · 4 comments

Comments

@pj-paul
Copy link

pj-paul commented Oct 30, 2019

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?

@fniessen
Copy link
Owner

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.

@fniessen
Copy link
Owner

PS- Do you have extra macros you'd think would be worth adding for the community?

@pj-paul
Copy link
Author

pj-paul commented Oct 30, 2019

@fniessen Thanks for the response.

  1. Inlining macros at the head of the org-file works. The narrowed sub-tree exports without errors.

  2. Will ask on org-mode mailing list + Stack-exchange.

  3. 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.

@pj-paul
Copy link
Author

pj-paul commented Oct 30, 2019

On 3, I found this article on chaining macros. Maybe this might inspire some ideas for you. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants