Re: How to set options for verbatim environments produced by org babel

2020-11-10 Thread Titus von der Malsburg


Thanks, Eric.  I didn’t know results could be detached from their code blocks 
via names.  That’s really useful.

However, a clean way to pass options to the verbatim (or listing) environment 
used for displaying results would be great nonetheless.

  Titus

On 2020-11-09 Mo 13:23, Eric S Fraga wrote:
> On Monday,  9 Nov 2020 at 12:28, Titus von der Malsburg wrote:
>> Is there a way to set options for the verbatim environment in Org mode?
>
> I cannot answer your actual question but I achieve the same outcome in a
> different manner.  I name my src blocks and then add LaTeX directives to
> the output as required:
>
> #+begin_src org
>   ,#+name: rblock
>   ,#+BEGIN_SRC octave :exports results :results value output
> 1+2
>   ,#+END_SRC
>
>   ,#+latex: {\small 
>   ,#+results: rblock
>   : ans =  3
>   ,#+latex: }
> #+end_src
>
> (I had to change your example to octave as I don't have R installed ;-))
>
> I do this all the time with beamer in particular to get output in my
> teaching slides.
>
> HTH,
> eric
>
> -- 
> : Eric S Fraga via Emacs 28.0.50, Org release_9.4-61-ga88806.dirty


-- 
Dr. Titus von der Malsburg
Dept. Linguistics, University of Potsdam
Dept. Brain & Cognitive Sciences, MIT
https://tmalsburg.github.io
PGP fingerprint: C34C 7364 EAAD 4752 FABA  35E6 AE34 59F3 C613 689D



Re: How to set options for verbatim environments produced by org babel

2020-11-09 Thread Eric S Fraga
On Monday,  9 Nov 2020 at 12:28, Titus von der Malsburg wrote:
> Is there a way to set options for the verbatim environment in Org mode?

I cannot answer your actual question but I achieve the same outcome in a
different manner.  I name my src blocks and then add LaTeX directives to
the output as required:

#+begin_src org
  ,#+name: rblock
  ,#+BEGIN_SRC octave :exports results :results value output
1+2
  ,#+END_SRC

  ,#+latex: {\small 
  ,#+results: rblock
  : ans =  3
  ,#+latex: }
#+end_src

(I had to change your example to octave as I don't have R installed ;-))

I do this all the time with beamer in particular to get output in my
teaching slides.

HTH,
eric

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4-61-ga88806.dirty



How to set options for verbatim environments produced by org babel

2020-11-09 Thread Titus von der Malsburg


I’m using the ~Verbatim~ environment from the fancyvrb package to display Org 
Babel results in my Beamer slides.  The ~Verbatim~ environment accepts options 
for setting the font size among other things.  This is useful when the output 
of a code block has longer lines that do not fit on a slide.

Is there a way to set options for the verbatim environment in Org mode?

Example: This Org source

  #+BEGIN_SRC R :exports results :results value output
  1+2
  #+END_SRC

exports to

  \begin{verbatim}
  3
  \end{verbatim}

But I’d like to be able to translate something like this:

  #+BEGIN_SRC R :exports results :results value output :options 
[fontsize=\small]
  1+2
  #+END_SRC

to

  \begin{verbatim}[fontsize=\small]
  3
  \end{verbatim}

I’m sure there is a way to do this but couldn’t find it.

  Titus