6

You can output formatted org tables by returning a list of lists as follows (notice no :results output): #+begin_src python :results replace table return (('a', 'a'), None, ('bbbbb', 'bbbbb')) #+end_src #+RESULTS: | a | a | |-------+-------| | bbbbb | bbbbb | a None row creates a separator line.


3

The org-babel-min-lines-for-block-output variable will help you accomplish this. I've set the following in my configuration files in order to make #+RESULTS code blocks be always enclosed within #+begin_example blocks (setq org-babel-min-lines-for-block-output 0) Here's an example #+begin_src cpp #include <iostream> int main() { std::cout <<...


2

I found the answer: #+begin_src bsh.dash :results verbatim :exports both :wrap "example" echo | time possiblycat 1000 #+end_src #+RESULTS: #+begin_example possiblycat 1000 0.00s user 0.00s system 68% cpu 0.005 total; max RSS 1888 #+end_example


1

Hmm, the Org documentation isn't very clear on the intended behavior here. I'm looking at the Results of Evalution page. But the workhorse function org-babel-eval is clear in its docstring that results only come back if the command succeeds. If the command fails, stdout is not returned and instead stderr is displayed in an error buffer. org-babel-eval ...


1

If you look at ob-C.el function org-babel-C-execute, you'll see that it compiles and links a program to tmp-bin-file, then runs it and captures its output to results. So you need a different source-file type eg cpp-wrong that you would execute using shell that invokes g++ and captures its stderr as you hinted above. Maybe copy ob-C.el and try to modify it ...


1

Note: For everyday coding, I use code blocks to filter table data instead of Indexable Variable Values (IVV) because it is usually faster to write and explain the code block than it is to teach others or remember IVV syntax. Use : to select range of org-table columns when using Indexable Variable Values "Ranges of variable values can be referenced ...


1

Which 15.6 Results of Evaluation options are needed? Collection: value Why? Because output puts it into scripting mode and you need to write to the standard output stream for the results. My initial problems with value was that I was trying to return an elisp list as the result of the function, and org-mode was pretty printing the list onto a single line ...


Only top voted, non community-wiki answers of a minimum length are eligible