[Top][All Lists]

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

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

From: Thomas S. Dye
Subject: Re: [Orgmode] org-babel: Meta-LaTeX-Python-Environment
Date: Tue, 27 Oct 2009 14:40:02 -1000

On Oct 27, 2009, at 12:55 PM, Eric Schulte wrote:

Torsten Wagner <address@hidden> writes:

Perhaps this will do what you want? When I run org-babel-tangle on the following org file, and then LaTeX the output, the resulting pdf file says: A bit of LATEX code, with the result: 6

I just wonder if there is a more comfortable method rather then
creating a file.

Although I still don't fully understand the need to embed latex *inside* of source-code blocks, perhaps the attached org-babel-latex.el file [1]
will represent a simpler solution for embedding the results of
source-code blocks in latex source-code blocks.  It makes use of
the :var org-babel header argument as shown in the attached example file
[2].  To reproduce first load org-babel-latex.el and then evaluate the
latex block (note the results are already in the file from my test

Hope this helps -- Eric

[1]  <org-babel-latex.el>
[2]  <latex.org>

Thanks for this, Eric. It looks neat. I was happy with all the little .tex files, but agree with Torsten that this path is potentially cleaner.

In response to the implicit question in your comment, perhaps there isn't a need to embed LaTeX inside source blocks and the uses to which I put them could be accomplished in org-mode without them. My programming skills are pretty crude and I'm aware that I'm a long way from understanding org-mode and its vast potential. With that caveat, here is my $0.02.

First, practical reasons:

1) I'm comfortable writing LaTeX and am particular about the results; it is hard for me to map the inverse transformation through the org- mode LaTeX exporter to express in org the particular LaTeX result I'm after.

2) Someone on the list (Carsten?) mentioned a couple of days ago that it wasn't reasonable to expect the org LaTeX exporter to capture the full complexity of LaTeX (I'm paraphrasing, but I think that was the gist); I ran up against an example of this (or so I think) when trying to configure export to beamer code, where beamer's use of columns tripped me up.

Second, conceptual reasons:

1) I consider writing LaTeX to be programming (here I mean no disrespect to real programmers) and appreciate being able to do literate LaTeX programming; the LaTeX source blocks let me write my beamer presentation a slide or two at a time, just as I want them, along with an adjacent source block for my print document, just as i want it, that covers the same conceptual space, while I use the surrounding org entries to document why I am doing things a particular way, etc.

2) I think this workflow, with an org-mode meta-document that encapsulates the print document and presentation materials, along with the SQL, R, and Python code used to create the datasets and analyze them, takes org-babel a step closer to realizing its potential as a tool for reproducible research. Here, I am thinking of an org document that captures the ways in which a piece of research is one logical path among many possibilities, implemented and expressed in one particular way (or two, if you want to distinguish print from presentation) among many possibilities.

The LaTeX source blocks in org-babel give me an easy and natural way to accomplish these things. In the short time I've used them, they've yielded results that impress me. I'm confident they hold much more potential than I've been able to tap.

It is a real pleasure leveraging your good work.


reply via email to

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