I have an org-mode document with a number of code blocks. Some of these take a long time to run, so I don't want to re-evaluate them each time I do an export.
I know I can prevent the re-evaluation by setting org-export-babel-evaluate to nil, but when I do this it won't print out the results of previous evaluations either, even if I have the code block "results" option set to "output".
Yes, I know I can remove the "#+results:" line from before the results block by hand, but this gets annoying whenever I need to reevaluate by hand, for example when I make a code change.
So, how can I get it to export the old results rather than re-evaluating each time?
You want to set your header argument to include :exports both
or :exports results
.
For example (The differences in time are due to evaluation when creating the headlines with C-c C-c
, I left them as such to make sure there was no further evaluation):
* Testing - results
#+name: test
#+begin_src sh :exports results
uptime
#+end_src
#+RESULTS:
| 15:49:23 up 2:00 | 2 users | load average: 0.00 | 0.0 | 0.0 |
* Testing - both
#+name: test
#+begin_src sh :exports both
uptime
#+end_src
#+RESULTS:
| 15:50:02 up 2:01 | 2 users | load average: 0.00 | 0.0 | 0.0 |
Produces the following ASCII C-c C-e A
1 Testing - results
--------------------
15:49:23 up 2:00 2 users load average: 0.00 0.0 0.0
2 Testing - both
-----------------
uptime
15:50:02 up 2:01 2 users load average: 0.00 0.0 0.0
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments