emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Guidance for preparing document with code


From: Sebastien Vauban
Subject: Re: [O] Guidance for preparing document with code
Date: Wed, 29 May 2013 19:00:41 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3 (windows-nt)

Hello,

Thomas S. Dye wrote:
> SabreWolfy <address@hidden> writes:
>
>> I'm using Org ~7.8 and would like to prepare a document for export to HTML
>> to make available to others to read. This document will contain heading,
>> text, etc., R code (for my reference) and the output of the R code. Where
>> should I look to learn how to do this in R? Org-babel? 
>
> Org mode should do what you want pretty much out of the box.  Note that
> the exporters all changed with Org 8, so you'll want to distinguish
> between the old and new exporters if you look for information on line.
>
>> Is this literate programming?
>
> I don't think so.  The end result of literate programming is typically a
> computer program rather than a document.

Just for the sake of accuracy, I'd say that "the end result of literate
programming is typically both a computer program *and* its documentation".

Getting the code out of the mixed source is called "tangling", while
generating the documentation (which shows both the code and explains it at the
same time) is called "weaving".

For the rest, you've received all the needed information so far, I guess.

Little starter for your R code:

#+BEGIN_SRC R :results graphics :file testout.png
plot(1:10, (1:10)^2)
#+END_SRC

produces (when evaluated in the buffer):

#+results:
[[file:testout.png]]

Up to you to see whether you want to export (when generating the HTML
document) the code, its results, both or none, by setting correctly the
":exports" header argument.

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

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