From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] Re: org-babel: Meta-LaTeX-Python-Environment Date: Wed, 28 Oct 2009 11:15:03 -0600 Message-ID: References: <200910261327.09576.torsten.wagner@googlemail.com> <878wexheeq.fsf@stats.ox.ac.uk> <4edb2bbc0910270757i3911f817jd99bc68eb4639e31@mail.gmail.com> <87aazblctf.fsf_-_@stats.ox.ac.uk> <794E6720-7BB4-4AE9-BCDF-C5714E2808DA@tsdye.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3C7C-0001FL-4u for emacs-orgmode@gnu.org; Wed, 28 Oct 2009 13:15:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3C76-0001AM-Bk for Emacs-orgmode@gnu.org; Wed, 28 Oct 2009 13:15:17 -0400 Received: from [199.232.76.173] (port=51326 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3C76-0001AD-7v for Emacs-orgmode@gnu.org; Wed, 28 Oct 2009 13:15:12 -0400 Received: from mail-pw0-f47.google.com ([209.85.160.47]:48949) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N3C75-0006o2-Dc for Emacs-orgmode@gnu.org; Wed, 28 Oct 2009 13:15:12 -0400 Received: by pwj10 with SMTP id 10so957190pwj.26 for ; Wed, 28 Oct 2009 10:15:06 -0700 (PDT) In-Reply-To: <794E6720-7BB4-4AE9-BCDF-C5714E2808DA@tsdye.com> (Thomas S. Dye's message of "Wed, 28 Oct 2009 06:52:50 -1000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Thomas S. Dye" Cc: Dan Davison , Emacs-orgmode@gnu.org "Thomas S. Dye" writes: > On Oct 28, 2009, at 6:10 AM, Dan Davison wrote: >> Am I right in thinking that one issue remaining in this thread is that >> we currently have no means of tangling the output of org-babel-latex? >> Thus the 'begin_src latex' blocks that we can tangle have unevaluated >> variables, and the resulting 'begin_latex' blocks have evaluated >> variables but can't be tangled? (We could extend tangling to cover >> such >> blocks, or perhaps preferably use ':results code' to generate >> begin_src >> latex' blocks?) >> >> Dan > > Hi Dan, > > I haven't found time to evaluate org-babel-latex, but, yes, the > example provided with the code raised a concern that the 'begin_latex' > blocks are divorced from the literate programming structure built up > by the named 'begin_src latex' blocks. Ideally, I think, the > begin_latex' blocks would replace <> references to their > source 'begin_src latex' blocks, or would employ some other mechanism > that doesn't break the literate programming structure I create. > I just started a new branch [1] in the org-mode/babel [2] repository where we should be able to implement a solution without too much trouble. If we expand the noweb syntax such that if a source-code block name has parenthesis "()" appended to the end of it's name, then the block will be evaluated during noweb reference expansion and it's results will be placed in the source-code block. That structure should even allow simple literal arguments to be passed to the referenced block. So for example what I'm proposing is that in the following case this --8<---------------cut here---------------start------------->8--- #+srcname: noweb-example #+begin_src python :var a=0 a+10 #+end_src #+begin_src latex :tangle somewhere \begin{itemize} \item <> \item <> \item <> \end{itemize} #+end_src --8<---------------cut here---------------end--------------->8--- would tangle to somewhere.tex as --8<---------------cut here---------------start------------->8--- \begin{itemize} \item a+10 \item 10 \item 18 \end{itemize} --8<---------------cut here---------------end--------------->8--- Does that sound appropriate? -- Eric Footnotes: [1] http://repo.or.cz/w/org-mode/babel.git?a=shortlog;h=refs/heads/noweb-evaluate [2] http://repo.or.cz/w/org-mode/babel.git