From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Guidance for preparing document with code Date: Wed, 29 May 2013 13:47:00 -0400 Message-ID: <87y5axk7aj.fsf@pierrot.dokosmarshall.org> References: <8738t5lq77.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhkT0-0007oD-OP for emacs-orgmode@gnu.org; Wed, 29 May 2013 13:47:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhkSv-0000bR-Gg for emacs-orgmode@gnu.org; Wed, 29 May 2013 13:47:18 -0400 Received: from plane.gmane.org ([80.91.229.3]:34968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhkSv-0000bA-9q for emacs-orgmode@gnu.org; Wed, 29 May 2013 13:47:13 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UhkSu-0005dx-DH for emacs-orgmode@gnu.org; Wed, 29 May 2013 19:47:12 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 May 2013 19:47:12 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 May 2013 19:47:12 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org SabreWolfy writes: > Nick Dokos gmail.com> writes: > >> org-babel is the right tool. Getting the headers right might involve >> some fiddling: there have been many question on the ML about those so >> you can try searching, but if after some effort you are still running >> into a wall, just post what you have, what you want to accomplish and >> how your purported solution fails: there are lots of people able and >> willing to help. The only thing to keep in mind is that the shorter the >> example, the better: don't post your 100-page org file; extract the >> example(s) that you want help with. > > Thanks. Apologies -- I meant *headers* (ie: a structured/outline-type > document), not *headings*. > I think you used the right terminology the first time: those are usually referred to as ``headings''. The ``headers'' I was referring to are the header arguments in a code block. I should have said ``header arguments'' explicitly - see e.g. (info "(org) Working with source code") >> If you are using the R code for your reference, and only presenting the >> results, that's *not* literate programming: you don't have to worry >> about the noweb stuff. >> > > I wanted to include explanatory text, the R code, then the output of the > code, all in the same document. The R code will not be relevant to the > reader, but I'd like it included and executed to produce output. > You can do that with babel: the ":exports both" header argument allows both code and results to be exported. We can argue whether this is literate programming but it's probably not a useful argument: it's not black and white, there is a continuous spectrum. As Seb explained, literate programming is (usually) about presenting a program (usually a *large* program) in logical pieces, interleaving the explanations with program fragments and depending on the system to a) "tangle" all the program fragments into a program that can actually be run without any modifications and b) "weave" the code fragments and explanations into a document (e.g. a book). -- Nick