emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Confused about source code blocks evaluation when exporting


From: Fraga, Eric
Subject: Re: Confused about source code blocks evaluation when exporting
Date: Tue, 12 Jul 2022 14:08:17 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

On Tuesday, 12 Jul 2022 at 14:53, Alain.Cochard@unistra.fr wrote:
> So far so good.  (Well almost: why does '#+RESULTS:' show 'bar' and
> not 'foo'?  After all, I'm just setting 'my-var', I'm not asking to
> display its value.  But that's incidental.)

It's not incidental.  By default, the results of a src block evaluation
is the value of the src block which is typically the value returned by
the last statement.  You can modify this by adding

:results output

for instance to the begin_src line.

> (test 2) Same org file.  If I do 'C-c C-e l o', no question is asked,
> no '#+RESULTS:' block is inserted, and the resulting pdf file shows:

On export, the default is to export the code.  If you want the results,
you need to add

:exports results

or if you want both code and results,

:exports both

-- 
: Eric S Fraga, with org release_9.5.4-613-gb3b17c in Emacs 29.0.50


reply via email to

[Prev in Thread] Current Thread [Next in Thread]