#+srcname: booktabs-2 #+begin_src emacs-lisp :var table='((:head) hline (:body))
(flet ((to-tab (tab) (orgtbl-to-generic (mapcar (lambda (lis) (if (listp lis) (mapcar (lambda (el) (if (stringp el)
el (format "%S" el))) lis) lis)) tab) (list :lend " \\\\" :sep " & " :hline "\\hline"))))
(org-fill-template " \\toprule %table \\bottomrule\n" (list (cons "table" ;; only use \midrule if it looks like there are column headers (if (equal 'hline (second table))
(concat (to-tab (list (first table))) "\n\\midrule\n" (to-tab (cddr table))) (to-tab table)))))) #+end_src
=== cut here end ===
Unfortunately, I get the error message : org-export-latex-preprocess: Wrong type argument: integer-or-marker-p, nil
But when I comment the content of one of the 3 headers, the export is done just fine. The combination of a footnote, a macro call and a code block evaluation seems to be not compatible. Sounds weird, doesn't it?