emacs-orgmode
[Top][All Lists]
Advanced

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

[O] macro expansion in source code


From: Johannes Rainer
Subject: [O] macro expansion in source code
Date: Thu, 29 Aug 2013 13:52:15 +0200

hi,

I was just wondering if there is a way to use macro expansion also in source code blocks or headers. I tried this, but the macro was never expanded, but rather the {{{image_width}}} was exported. could the expansion be done by calling the macro expansion before export (e.g. using a hook)?

something like this:

#+MACRO: image_width 16

#+BEGIN_SRC R :results silent :exports code
  IMAGE <- "test.png"
  WIDTH <- {{{image_width}}}
  HEIGHT <- 6
  png( file=IMAGE, width=WIDTH, height=HEIGHT, units="cm", res=600, pointsize=6 )
  library( RColorBrewer )
  display.brewer.all()
  dev.off()
#+END_SRC


or

#+BEGIN_SRC R :results file :exports results :width {{{image_width}}}
  display.brewer.all()
#+END_SRC


cheers, jo


reply via email to

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