[Top][All Lists]

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

[O] «Macro» expansion in source blocks; code-sharing between blocks

From: Tobias Getzner
Subject: [O] «Macro» expansion in source blocks; code-sharing between blocks
Date: Thu, 18 Sep 2014 13:17:14 +0000 (UTC)
User-agent: Pan/0.140 (Chocolate Salty Balls; GIT d447f7c /tmp/yaourt-tmp-seb/aur-pan-git/pan2)


I was wondering whether there exists some way of sharing literal code 
(or, possibly, code results) between subsequent code blocks. E.g., I was 
trying to create a document containing several tikz graphics, and I would 
like to share a number of style definitions between these. When I only 
export to LaTeX, I can of course just use isolated BEGIN_LATEX blocks, 
and refer to shared stuff using LaTeX semantics. But I was wondering if 
something like this could possibly be done using code blocks only.

It seemed to me that there are two «expansion mechanisms» for source code 
in org: 1. Calling named source blocks; 2. macro expansion.

As for 1., calling a named block from within another isn’t currently 
handled, is it? As for 2., macro expansion only occurs upon export, 
right? While I found an interesting proposal to expand macros within 
source code at [1], this supposedly only works when either doing an 
export or when tangling an external file.

Are there any convenient inline-expansion methods I might have overlooked?

Best regards,

[1] https://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg00843.html

reply via email to

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