From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tobias Getzner Subject: =?UTF-8?B?wqtNYWNyb8K7IGV4cGFuc2lvbiBpbiBzb3VyY2UgYmxvY2tzOyBj?= =?UTF-8?B?b2RlLXNoYXJpbmcgYmV0d2VlbiBibG9ja3M=?= Date: Thu, 18 Sep 2014 13:17:14 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUbab-0001yl-3W for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 09:17:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUbaU-0006zO-Ms for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 09:17:36 -0400 Received: from plane.gmane.org ([80.91.229.3]:46183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUbaU-0006uk-GB for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 09:17:30 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XUbaO-00061r-9i for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 15:17:24 +0200 Received: from g228190172.adsl.alicedsl.de ([92.228.190.172]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Sep 2014 15:17:24 +0200 Received: from tobias.getzner by g228190172.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Sep 2014 15:17:24 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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