
"cberry@tajo.ucsd.edu" <cberry@tajo.ucsd.edu> writes:

> Michael Hannon <jm_hannon@yahoo.com> writes:
> 
> > Hi, Sven.  Have you considered using the Babel feature of Emacs Org-Mode?
> >
> >     http://orgmode.org/worg/org-contrib/babel/intro.html
> >
> > -- Mike
> 
> Mike,
> 
> FWIW, I use something like this:
> 
> * Example
> 
> 
> #+results: sample2
> #+begin_src latex :eval never :exports none
>   Start with three letters: <%=sample(letters,3)%>,
>   Then go for three numbers: <%=sample(0:9,3)%>.
> #+end_src
> 
> 
> #+begin_src R :var txt=sample2 :results output org :exports results
> require(brew)
> brew( text=sub( "\n[ ]+", "\n", txt) )
> #+end_src
> 
> 
> Then I can edit the brew script in AucTeX-mode and export to ascii or
> latex or whatever.
> 
> But maybe there is a slicker way to do this.
> 
> ??

Hi, Chuck.  Let me first of all state that I'm not the guy you should be using
as a reference for Emacs Org-Mode, although I have been using it a bit lately.

I'm not sure what the "brew" stuff adds in the above.  If I have the following
in a .org file:

    #+BABEL: :session *R*

    * Example
    
    #+begin_src R :results output :exports results
      
      tl <- sample(letters, 3)
      tn <- sample(0:9, 3)
      cat ("Start with three letters: ",  tl, "\n")
      cat ("Then go for three numbers: ", tn, "\n")
      
      
    #+end_src

then I can run the command "org-export" (bound to C-c C-e) to export directly
to ASCII, DobBook, HTML, LaTeX, PDF, etc.  I don't need the "brew" step, and I
don't need the "output org" step.  I can also intermix (using other
"begin_src" blocks) LaTeX code, HTML code, Python code, etc., in the same file
and have it all integrated into the final, exported document.

Perhaps I'm missing the obvious?

-- Mike
	[[alternative HTML version deleted]]

