Possible false alarm. As I continued to work on this, I accidentally didn't use :results output code, yet the formatting was fine... I'm wondering if I had a dangling #+begin_src with no matching end?
Still, I am intrigued by the toggle between prepending with ":" and wrapping in example blocks, despite what appears to be no practical impact at this point. John On Thu, Jan 13, 2022 at 2:49 PM John Hendy <jw.he...@gmail.com> wrote: > > 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