emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* What determines if R source block output is wrapped in begin_example or not?
@ 2022-01-13 20:49 John Hendy
  2022-01-14  3:04 ` John Hendy
  0 siblings, 1 reply; 6+ messages in thread
From: John Hendy @ 2022-01-13 20:49 UTC (permalink / raw)
  To: emacs-orgmode

Greetings,

I was perplexed when a table in my exported latex/pdf document came
out garbled, to find out it's being included like "normal text." In
another block with well-behaving output, I observed the same src
header args, but it was wrapped in #+begin/end_example for free,
without me trying.

Here's a reproducible example. This output would not look right when exported:

#+begin_src R :exports results :results output :eval yes
data.frame(
  x = c(1:3))
#+end_src

#+RESULTS:
:   x
: 1 1
: 2 2
: 3 3

From trial and error, it seems the magical length is 9 where it gets wrapped:

#+begin_src R :exports results :results output :eval yes
data.frame(
  x = c(1:9))
#+end_src

#+RESULTS:
#+begin_example
  x
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
#+end_example

I see nothing like this mentioned in the docs on the results of evaluation:
https://orgmode.org/manual/Results-of-Evaluation.html

For now, my workaround is to use :results output code. I guess my
typical output must usually be longer than 9, or I use :results value
and manually add header rows to the generated org table, as I don't
recall dealing with this before!

Thanks for help understanding.

Best regards,
John


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

end of thread, other threads:[~2022-01-14 15:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-13 20:49 What determines if R source block output is wrapped in begin_example or not? John Hendy
2022-01-14  3:04 ` John Hendy
2022-01-14  9:48   ` Eric S Fraga
2022-01-14 13:13     ` John Hendy
2022-01-14 14:04       ` Eric S Fraga
2022-01-14 14:44         ` Ihor Radchenko

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).