What could possibly preventing execution of code blocks upon export to pdf, if
:results is set to
silent on the relevant codeblock but I don't think that should affect execution upon export.
If I set
results the file outputted by the code block is inserted at the end of the document.
If I set
both the file is inserted correctly (ie where the link is), but then the codeblock is of course also inserted. Neither is useful as I would just like the file generated by the codeblock to be inserted at the location of the link.
** CODE #+begin_src clojure :var bc=case :colnames no :results silent :tangle ../src/roight/core.clj (ns roight.core (:require [roight.org] [roight.sim] [incanter.core] [incanter.charts] [incanter.pdf])) (defn calc-bc [bc] (apply #(- (* (+ %1 %2 %3) %5) (* %4 %5)) bc)) (defn sample-business-case [case i] (map calc-bc (repeatedly i #(map roight.sim/sample case)))) (let [business-case (roight.org/org-table->map bc) chart (incanter.charts/histogram (sample-business-case business-case 20000))] (incanter.core/view chart) (incanter.core/save chart "org/business-case.png")) #+end_src ** Illustration #+CAPTION: Simulation of the business case #+NAME: fig:business_case_simulation [[./business-case.png]]
I am using Emacs 184.108.40.206 and org-mode 8.3.2 on OSX.
Remark by Tobias:
The effect described by mac cannot be reproduced with the html-file export of the following example using an
emacs-lisp code block,
emacs 24.3.1 and
org-mode 8.3.2. The figure is shown between the first and the second sentence -- as it is expected. This rises the question whether the problem is clojure-specific.
#+begin_src emacs-lisp :exports results :results silent (with-current-buffer (find-file-noselect "testsvg.svg") (delete-region (point-min) (point-max)) (insert "<svg version=\"1.1\" baseProfile=\"full\" width=\"300\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\"> <rect width=\"100%\" height=\"100%\" fill=\"red\"/> <text x=\"150\" y=\"125\" font-size=\"60\" text-anchor=\"middle\">Test</text> </svg>") (save-buffer)) #+end_src ** Illustration The figure is placed below this first sentence. #+CAPTION: Simulation of the business case #+NAME: fig:business_case_simulation [[./testsvg.svg]] The figure is placed above this second sentence.