emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* «Macro» expansion in source blocks; code-sharing between blocks
@ 2014-09-18 13:17 Tobias Getzner
  2014-09-18 13:26 ` Tobias Getzner
  0 siblings, 1 reply; 14+ messages in thread
From: Tobias Getzner @ 2014-09-18 13:17 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

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,
Tobias


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-09-21  4:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 13:17 «Macro» expansion in source blocks; code-sharing between blocks Tobias Getzner
2014-09-18 13:26 ` Tobias Getzner
2014-09-18 14:01   ` Eric S Fraga
2014-09-18 14:40     ` Tobias Getzner
2014-09-18 23:44     ` Andreas Kiermeier
2014-09-19  2:59       ` Charles Berry
2014-09-19 10:18         ` Andreas Kiermeier
2014-09-19  7:44       ` Eric S Fraga
2014-09-19  9:04       ` Rainer M Krug
2014-09-19 10:19         ` Andreas Kiermeier
2014-09-19 10:59           ` header arguments, inheritance, and noweb expansion Was: " Rainer M Krug
2014-09-20  6:57             ` Andreas Kiermeier
2014-09-20 16:06               ` Charles Berry
2014-09-21  4:19                 ` Andreas Kiermeier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).