emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Including file from a macro?


From: Diego Zamboni
Subject: [O] Including file from a macro?
Date: Wed, 27 Jun 2018 09:57:44 +0200

Hi,

Is it possible to use "#+include" from within a macro?

I have the following two files:

t1.org:
-----
#+MACRO: newline    (eval "\n")
#+MACRO: module-summary ** $1 {{{newline}}}{{{newline}}}#+include: "./$1.org::file-summary"

{{{module-summary(t2)}}}
-----

t2.org:
-----
* t2 file

#+name: file-summary
This is the file summary
-----

This is another paragraph

If I export t1.org to org-mode, I get the following, which, if exported to any other format (I have tested HTML and Markdown), correctly includes the "file-summary" paragraph:

t1.org.org:
-----
# Created 2018-06-27 Wed 09:26
#+TITLE:
#+AUTHOR: Zamboni Diego
#+macro: newline    (eval "\n")
#+macro: module-summary ** $1 {{{newline}}}{{{newline}}}#+include: "./$1.org::file-summary"

* t2

#+include: "./t2.org::file-summary"
-----

However, if I export t1.org directly to HTML or Markdown, I get only the heading "* t2", but no included contents, as if the #+include line is not being processed correctly.

Any ideas if this is possible?

Thanks,
--Diego


reply via email to

[Prev in Thread] Current Thread [Next in Thread]