Eric Schulte writes: > Hi Tom, > > This sounds great, would you mind submitting this as a patch to the > library-of-babel.org file in the git repository, with some included > usage instructions in the same subtree as the code block? > > Thanks! -- Eric > > tsd@tsdye.com (Thomas S. Dye) writes: > >> Hi Eric, >> >> The booktabs-notes function, below, is based on the booktabs function in >> the library of Babel. It takes a second table and adds it to the bottom >> of the main table. I use it to add multicolumn footnotes to the bottom >> of the table. There is also a switch that adds a linespace between the >> main table and the notes table. I think the function might be a useful >> addition to the library of Babel. >> >> I tried to design it to be a functional replacement for the booktabs >> function, but don't trust my emacs-lisp (or other) programming skills. >> >> All the best, >> Tom >> >> #+srcname: booktabs-notes >> #+begin_src emacs-lisp :var table='((:head) hline (:body)) :var notes='() :var align='() :var env="tabular" :var width='() :var lspace='() :noweb yes :results latex >> (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 >> " >> \\begin{%env}%width%align >> \\toprule >> %table >> \\bottomrule%spacer >> %notes >> \\end{%env}\n" >> (list >> (cons "env" (or env "table")) >> (cons "width" (if width (format "{%s}" width) "")) >> (cons "align" (if align (format "{%s}" align) "")) >> (cons "spacer" (if lspace "\\addlinespace" "")) >> (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))) >> (cons "notes" (if notes (to-tab notes) "")) >> ))) >> #+end_src Hi Eric, Here is the patch that adds the booktabs-notes source block. I took the liberty of editing the description of the booktabs source block, which contained a contradiction about the number of required and optional arguments. Take a look to make sure I resolved the contradiction correctly. I tried to follow Bastien's suggestion about adding a change log to the commit message, but ended up with something that looks different than his example. I'm not sure why--perhaps Bastien is not working in magit, so his instructions apply to some other context? All the best, Tom