- publishing free software manuals
The Org Mode 7 Reference Manual
by Carsten Dominik and others
Paperback (6"x9"), 282 pages
ISBN 9781906966089
RRP £9.95 ($14.95)

Sales of this book support the Org project! Get a printed copy>>>

14.8.2.2 :results

There are three classes of :results header argument. Only one option of each type may be supplied per code block.

collection
header arguments specify how the results should be collected from the code block
type
header arguments specify what type of result the code block will return--which has implications for how they will be inserted into the Org-mode buffer
handling
header arguments specify how the results of evaluating the code block should be handled.

Collection

The following options are mutually exclusive, and specify how the results should be collected from the code block.

value
This is the default. The result is the value of the last statement in the code block. This header argument places the evaluation in functional mode. Note that in some languages, e.g., Python, use of this result type requires that a return statement be included in the body of the source code block. E.g., :results value.
output
The result is the collection of everything printed to STDOUT during the execution of the code block. This header argument places the evaluation in scripting mode. E.g., :results output.

Type

The following options are mutually exclusive and specify what type of results the code block will return. By default, results are inserted as either a table or scalar depending on their value.

table, vector
The results should be interpreted as an Org-mode table. If a single value is returned, it will be converted into a table with one row and one column. E.g., :results value table.
scalar, verbatim
The results should be interpreted literally--they will not be converted into a table. The results will be inserted into the Org-mode buffer as quoted text. E.g., :results value verbatim.
file
The results will be interpreted as the path to a file, and will be inserted into the Org-mode buffer as a file link. E.g., :results value file.
raw, org
The results are interpreted as raw Org-mode code and are inserted directly into the buffer. If the results look like a table they will be aligned as such by Org-mode. E.g., :results value raw.
html
Results are assumed to be HTML and will be enclosed in a begin_html block. E.g., :results value html.
latex
Results assumed to be LaTeX and are enclosed in a begin_latex block. E.g., :results value latex.
code
Result are assumed to be parseable code and are enclosed in a code block. E.g., :results value code.
pp
The result is converted to pretty-printed code and is enclosed in a code block. This option currently supports Emacs Lisp, Python, and Ruby. E.g., :results value pp.

Handling

The following results options indicate what happens with the results once they are collected.

silent
The results will be echoed in the minibuffer but will not be inserted into the Org-mode buffer. E.g., :results output silent.
replace
The default value. Any existing results will be removed, and the new results will be inserted into the Org-mode buffer in their place. E.g., :results output replace.
append
If there are pre-existing results of the code block then the new results will be appended to the existing results. Otherwise the new results will be inserted as with replace.
prepend
If there are pre-existing results of the code block then the new results will be prepended to the existing results. Otherwise the new results will be inserted as with replace.
ISBN 9781906966089The Org Mode 7 Reference ManualSee the print edition