library-of-babel: back to a single function per table environment

This commit is contained in:
Eric Schulte 2010-06-28 13:23:48 -07:00
parent da8fffa5a4
commit 96961abd3b
1 changed files with 5 additions and 7 deletions

View File

@ -99,12 +99,11 @@ plot(data)
* Tables * Tables
** LaTeX Table export ** LaTeX Table export
This block can be used to wrap a table in the latex =longtable= This block can be used to wrap a table in the latex =longtable=
environment, it takes the following arguments -- all but the first environment, it takes the following arguments -- all but the first two
three are optional. are optional.
| arg | description | | arg | description |
|-----------+-------------------------------------------------------------| |-----------+-------------------------------------------------------------|
| table | a reference to the table | | table | a reference to the table |
| env | table environment, e.g. longtable, tablex, etc... |
| align | optional alignment string | | align | optional alignment string |
| width | optional width specification string | | width | optional width specification string |
| hline | the string to use as hline separator, defaults to "\\hline" | | hline | the string to use as hline separator, defaults to "\\hline" |
@ -113,20 +112,19 @@ three are optional.
| foot | optional "foot" string | | foot | optional "foot" string |
| lastfoot | optional "lastfoot" string | | lastfoot | optional "lastfoot" string |
#+srcname: table #+srcname: longtable
#+begin_src emacs-lisp :var table='((:table)) :var env="table" :var align='() :var width='() :var hline="\\hline" :var firsthead='() :var head='() :var foot='() :var lastfoot='() :noweb yes :results latex #+begin_src emacs-lisp :var table='((:table)) :var env="table" :var align='() :var width='() :var hline="\\hline" :var firsthead='() :var head='() :var foot='() :var lastfoot='() :noweb yes :results latex
(org-fill-template (org-fill-template
" "
\\begin{%env}%width%align \\begin{longtable}%width%align
%firsthead %firsthead
%head %head
%foot %foot
%lastfoot %lastfoot
%table %table
\\end{%env}\n" \\end{longtable}\n"
(list (list
(cons "env" env)
(cons "width" (if width (format "{%s}" width) "")) (cons "width" (if width (format "{%s}" width) ""))
(cons "align" (if align (format "{%s}" align) "")) (cons "align" (if align (format "{%s}" align) ""))
(cons "firsthead" (if firsthead (concat firsthead "\n\\endfirsthead\n") "")) (cons "firsthead" (if firsthead (concat firsthead "\n\\endfirsthead\n") ""))