This is the official manual for the latest Org-mode release.

Table of Contents

Next: , Previous: wrap, Up: Specific header arguments :post

The :post header argument is for post-processing results from ‘src’ block evaluation. When :post has any value, Org binds the results to *this* variable for easy passing to var header argument specifications. That makes results available to other code blocks, or for even direct Emacs Lisp code execution.

The following two examples illustrate :post header argument in action. The first one shows how to attach #+ATTR_LATEX: line using :post.

     #+name: attr_wrap
     #+begin_src sh :var data="" :var width="\\textwidth" :results output
       echo "#+ATTR_LATEX: :width $width"
       echo "$data"
     #+header: :file /tmp/it.png
     #+begin_src dot :post attr_wrap(width="5cm", data=*this*) :results drawer
               a -> b;
               b -> c;
               c -> a;
     #+ATTR_LATEX :width 5cm

The second example shows use of :colnames in :post to pass data between ‘src’ code blocks.

     #+name: round-tbl
     #+begin_src emacs-lisp :var tbl="" fmt="%.3f"
       (mapcar (lambda (row)
                 (mapcar (lambda (cell)
                           (if (numberp cell)
                               (format fmt cell)
     #+begin_src R :colnames yes :post round-tbl[:colnames yes](*this*)
     |   foo |
     | 1.371 |