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 used to post-process the results of a code block execution. When a post argument is given, the results of the code block will temporarily be bound to the *this* variable. This variable may then be included in header argument forms such as those used in var header argument specifications allowing passing of results to other code blocks, or direct execution via Emacs Lisp. Additional header arguments may be passed to the :post-function.

The following two examples illustrate the usage of the :post header argument. The first example shows how to attach a attribute-line via :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 examples shows how to use :post together with the :colnames header argument.

     #+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 |