emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Cannot expand macros through included org file


From: reza
Subject: Re: Cannot expand macros through included org file
Date: Wed, 15 Feb 2023 20:53:40 +0000

Hi Ihor

Thanks for your quick reply

> What you can do instead is creating a named Org paragraph with macro,
> like
> 
> #+name: year
> {{{year}}}

I tried this approach but it does not seem to work either:

"template.org":

   #+TITLE: Report
   #+NAME: year
   {{{year}}}

   * My headline

   #+BEGIN_SRC bash :var year=year
     ./get_log_file --start=$year-01-01 --end=$year-12-31
   #+END_SRC

   #+BEGIN_SRC python :var year=year
     log = pd.read_csv(f"log_{year}.csv")
   #END_SRC

"report_2019.org":

    #+TITLE: Report 2019
    #+MACRO: year 2019

    #+INCLUDE: "template.org" :lines "2-"

Cheers,
Reza

Attachment: OpenPGP_0xC375C6AF05125C52.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: PGP signature


reply via email to

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