Next: file, Previous: var, Up: Specific header arguments [Contents][Index]
:resultsThere are four classes of :results header arguments. Each ‘src’
code block can take only one option per class.
Collection options specify the results. Choose one of the options; they are mutually exclusive.
value
Default. Functional mode. Result is the value returned by the last
statement in the ‘src’ code block. Languages like Python may require an
explicit return statement in the ‘src’ code block. Usage
example: :results value.
output
Scripting mode. Result is collected from STDOUT during execution of the code
in the ‘src’ code block. Usage example: :results output.
Type tells what result types to expect from the execution of the code block. Choose one of the options; they are mutually exclusive. The default behavior is to automatically determine the result type.
table, vector
Interpret the results as an Org table. If the result is a single value,
create a table with one row and one column. Usage example: :results
value table.
list
Interpret the results as an Org list. If the result is a single value,
create a list of one element.
scalar, verbatim
Interpret literally and insert as quoted text. Do not create a table. Usage
example: :results value verbatim.
file
Interpret as path to a file. Inserts a link to the file. Usage example:
:results value file.
Format pertains to the type of the result returned by the ‘src’ code block. Choose one of the options; they are mutually exclusive. The default follows from the type specified above.
raw
Interpreted as raw Org mode. Inserted directly into the buffer. Aligned if
it is a table. Usage example: :results value raw.
org
Results enclosed in a BEGIN_SRC org block. For comma-escape, either
TAB in the block, or export the file. Usage example: :results
value org.
html
Results enclosed in a BEGIN_EXPORT html block. Usage example:
:results value html.
latex
Results enclosed in a BEGIN_EXPORT latex block. Usage example:
:results value latex.
code
Result enclosed in a ‘src’ code block. Useful for parsing. Usage
example: :results value code.
pp
Result converted to pretty-print source code. Enclosed in a ‘src’ code
block. Languages supported: Emacs Lisp, Python, and Ruby. Usage example:
:results value pp.
drawer
Result wrapped in a RESULTS drawer. Useful for containing raw or
org results for later scripting and automated processing. Usage
example: :results value drawer.
Handling options after collecting the results.
silent
Do not insert results in the Org mode buffer, but echo them in the
minibuffer. Usage example: :results output silent.
replace
Default. Insert results in the Org buffer. Remove previous results. Usage
example: :results output replace.
append
Append results to the Org buffer. Latest results are at the bottom. Does
not remove previous results. Usage example: :results output append.
prepend
Prepend results to the Org buffer. Latest results are at the top. Does not
remove previous results. Usage example: :results output prepend.
Next: file, Previous: var, Up: Specific header arguments [Contents][Index]