emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] [babel] options to the example directive


From: Dan Davison
Subject: Re: [Orgmode] [babel] options to the example directive
Date: Tue, 03 Nov 2009 12:34:52 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Eric S Fraga <address@hidden> writes:

> I am finding org-babel incredibly useful in the preparation of
> documentation for didactic purposes.  Kudos to the developers!  
>
> I have two queries that I cannot seem to find an answer to in the
> documentation: 
>
> 1. is there any way to specify arguments that should be generated for
>    the #+begin_example line for the results of a babel invocation?

Not currently. When exporting the *code* contained in a block, then any
switches placed after begin_src are reinstated in the output code
block. I.e.

begin_src XXX <switches> :exports code
...

becomes

begin_src XXX <switches>
...

However when a begin_example block is created as *results*, it is
created without any switches. I'm tending to think that it would be
inappropriate to simply reinstate the src block switches in the results
block. How do you suggest this option should be made available? Perhaps
a new header arg, or as a variable org-babel-results-block-switches, or
both?

Note that you will need to set org-babel-min-lines-for-block-output to
zero in order to guarantee that output is enclosed in a begin_example
block. Otherwise small chunks of output will be made verbatim by
prepending lines with ': ', in which case (I believe) the -t switch is
unavailable.


>    Specifically, I would like to append automatically, for instance,
>    arguments such as "-t -w 100 -h 20" so that the export to HTML
>    output is presented in a text box that has scroll bars etc.

>
> 2. even if I manually put the options on the begin_example line, the
>    export to HTML creates a '<pre class="example">' directive instead
>    of what I would expect: '<textarea cols="40" rows="10">' or
>    something similar.  I don't understand why exporting a file without
>    babel constructs should behave differently from exporting with

This is a consequence of the same issue: org-exp-blocks preprocesses
your src block in a pre-export buffer (a copy of the original), hands it
to org-babel, which creates the results block (overwriting the version
where you had manually inserted switches), and that results block lacks
any switches.

Dan

>    babel.  Should a begin_example section not export the same in both
>    cases?
>
> I am using org-mode and babel up to date as of this morning.
>
> Any pointers highly welcome!
>
> Thanks,
> eric
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

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