Org-mode mailing list
 help / color / mirror / Atom feed
* How to set options for verbatim environments produced by org babel
@ 2020-11-09 11:28 Titus von der Malsburg
  2020-11-09 12:23 ` Eric S Fraga
  0 siblings, 1 reply; 3+ messages in thread
From: Titus von der Malsburg @ 2020-11-09 11:28 UTC (permalink / raw)
  To: emacs-orgmode


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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to set options for verbatim environments produced by org babel
  2020-11-09 11:28 How to set options for verbatim environments produced by org babel Titus von der Malsburg
@ 2020-11-09 12:23 ` Eric S Fraga
  2020-11-10 11:39   ` Titus von der Malsburg
  0 siblings, 1 reply; 3+ messages in thread
From: Eric S Fraga @ 2020-11-09 12:23 UTC (permalink / raw)
  To: Titus von der Malsburg; +Cc: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to set options for verbatim environments produced by org babel
  2020-11-09 12:23 ` Eric S Fraga
@ 2020-11-10 11:39   ` Titus von der Malsburg
  0 siblings, 0 replies; 3+ messages in thread
From: Titus von der Malsburg @ 2020-11-10 11:39 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-10 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 11:28 How to set options for verbatim environments produced by org babel Titus von der Malsburg
2020-11-09 12:23 ` Eric S Fraga
2020-11-10 11:39   ` Titus von der Malsburg

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git