I use R to plot data, and like to include information about the plot in the caption. I do this by combining two named SRC blocks--one for the image, and one for the caption--and then put their #+RESULTS: together. The caption is the tricky bit; I use R to print a string that starts with #+CAPTION:, shown in the exmaple below. While this works, I've wondered if there is a more elegant way to do this. How do others do this?
Kind Regards, Mike Gauland ----- example ----- #+NAME: image #+HEADER: :session #+HEADER: :results graphics #+HEADER: :exports results #+HEADER: :file (org-babel-temp-file "./figure-" ".pdf") #+BEGIN_SRC R x <- rnorm(100) hist(x) #+END_SRC #+NAME: caption #+HEADER: :session #+HEADER: :results raw #+HEADER: :exports results #+BEGIN_SRC R print(paste("#+CAPTION: The mean value is ", format(mean(x), digits=3), ".", sep="")); #+END_SRC #+RESULTS: caption #+RESULTS: image