From: "Eric Schulte" <schulte.eric@gmail.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: Dan Davison <davison@stats.ox.ac.uk>, Emacs-orgmode@gnu.org
Subject: Re: [babel] Re: org-babel: Meta-LaTeX-Python-Environment
Date: Wed, 28 Oct 2009 11:15:03 -0600 [thread overview]
Message-ID: <m2fx93v3s8.fsf@gmail.com> (raw)
In-Reply-To: <794E6720-7BB4-4AE9-BCDF-C5714E2808DA@tsdye.com> (Thomas S. Dye's message of "Wed, 28 Oct 2009 06:52:50 -1000")
"Thomas S. Dye" <tsd@tsdye.com> 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
next prev parent reply other threads:[~2009-10-28 17:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-26 4:27 org-babel: Meta-LaTeX-Python-Environment Torsten Wagner
2009-10-27 0:24 ` Dan Davison
2009-10-27 8:23 ` Thomas S. Dye
2009-10-27 14:57 ` Torsten Wagner
2009-10-27 22:55 ` Eric Schulte
2009-10-28 0:40 ` Thomas S. Dye
2009-10-28 15:19 ` Eric Schulte
2009-10-28 16:10 ` [babel] " Dan Davison
2009-10-28 16:49 ` Dan Davison
2009-10-28 16:52 ` Thomas S. Dye
2009-10-28 17:15 ` Eric Schulte [this message]
2009-10-28 18:46 ` Thomas S. Dye
2009-10-28 22:19 ` Eric Schulte
2009-10-29 6:55 ` Thomas S. Dye
2009-10-28 16:25 ` Thomas S. Dye
2009-10-27 13:29 ` Torsten Wagner
2009-10-29 15:52 ` [babel] Meta-LaTeX-Python-Environment Dan Davison
[not found] ` <4edb2bbc0910270625ybce9255nf569b5e250d061e1@mail.gmail.com>
2009-10-28 16:57 ` org-babel: Meta-LaTeX-Python-Environment Dan Davison
2009-10-29 4:52 ` [babel]org-babel: Meta-LaTeX-Python-Environment Torsten Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2fx93v3s8.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=Emacs-orgmode@gnu.org \
--cc=davison@stats.ox.ac.uk \
--cc=tsd@tsdye.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).