1

I have these settings for evaluating emacs lisp code in babel:

ELISP> org-babel-default-header-args:emacs-lisp
((:eval . "never-export")
 (:exports . "both")
 (:hlines . "yes")
 (:colnames . "no"))

Here is an example document.

#+TITLE: Title

Here is some advanced math.

#+BEGIN_SRC elisp
 (+ 1 1)
#+END_SRC

#+RESULTS:
: 2

And here is some more.

#+BEGIN_SRC elisp
 (+ 2 2)
#+END_SRC

When I export this document to pdf, the results are not exported. Why not? org-version holds 8.2.10.

1

Because :eval . "never-export" means " The code block will not be evaluated during export but may still be called interactively". You can either change this to "yes", or leave it the way it is and do M-x org-bable-execute-buffer before exporting.

Edit: It looks like the issue was not unevaluated code blocks as I assumed in the original answer. Rather, you should use the official identifier emacs-lisp rather than elisp, i.e.,

#+TITLE: Title

Here is some advanced math.

#+BEGIN_SRC emacs-lisp
 (+ 1 1)
#+END_SRC

#+RESULTS:
: 2

And here is some more.

#+BEGIN_SRC emacs-lisp
 (+ 2 2)
#+END_SRC
|improve this answer|||||
  • But what there is already a result for the first code block. I want to export that without having to execute the code block for the second one. – wdkrnls Feb 18 '15 at 16:55
  • 1
    Ah, I see. I guess you just need to set org-babel-default-header-args:elisp, or use #+BEGIN_SRC emacs-lisp as the code block delimiter. I've updated the answer. – Ista Feb 18 '15 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.