emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [babel] Re: [Orgmode] org-babel: Meta-LaTeX-Python-Environment


From: Eric Schulte
Subject: Re: [babel] Re: [Orgmode] org-babel: Meta-LaTeX-Python-Environment
Date: Wed, 28 Oct 2009 11:15:03 -0600
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (darwin)

"Thomas S. Dye" <address@hidden> 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 <<noweb>> 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 <<noweb-example>>
    \item <<noweb-example()>>
    \item <<noweb-example(a=8)>>
  \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





reply via email to

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