emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Guidance for preparing document with code
Date: Wed, 29 May 2013 13:47:00 -0400	[thread overview]
Message-ID: <87y5axk7aj.fsf@pierrot.dokosmarshall.org> (raw)
In-Reply-To: loom.20130529T192243-865@post.gmane.org

SabreWolfy <sabrewolfy@gmail.com> writes:

> Nick Dokos <ndokos <at> 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

  reply	other threads:[~2013-05-29 17:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29 15:33 Guidance for preparing document with code SabreWolfy
2013-05-29 16:06 ` Thomas S. Dye
2013-05-29 17:00   ` Sebastien Vauban
2013-05-29 17:28     ` SabreWolfy
2013-05-30 11:18     ` SabreWolfy
2013-05-29 17:26   ` SabreWolfy
2013-05-29 16:09 ` Thorsten Jolitz
2013-05-30 10:40   ` SabreWolfy
2013-05-29 16:13 ` Nick Dokos
2013-05-29 17:24   ` SabreWolfy
2013-05-29 17:47     ` Nick Dokos [this message]
2013-05-29 17:15 ` Marcin Borkowski
2013-05-29 17:30   ` SabreWolfy
2013-05-29 19:45     ` Marcin Borkowski

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=87y5axk7aj.fsf@pierrot.dokosmarshall.org \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).