From 3809f751afb8fffab1e07f7f4d6e607ed5a77b5b Mon Sep 17 00:00:00 2001 From: Tom Dye Date: Sun, 2 Oct 2011 05:49:52 -1000 Subject: [PATCH] * lisp/org-latex.el: added variable to toggle captions below tables --- lisp/org-latex.el | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 17626b5..f91b93e 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -73,7 +73,7 @@ org-deadline-string "\\|" org-closed-string"\\)") "Regexp matching special time planning keywords plus the time after it.") - +(defvar org-export-latex-table-caption-above t) (defvar org-re-quote) ; dynamically scoped from org.el (defvar org-commentsp) ; dynamically scoped from org.el @@ -1965,13 +1965,13 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (concat "\\begin{longtable}{" align "}\n") (if floatp (format "\\begin{%s}%s\n" tblenv placement))) - (if floatp + (if (and floatp org-export-latex-table-caption-above) (format "\\caption%s{%s} %s" (if shortn (concat "[" shortn "]") "") (or caption "") (if label (format "\\label{%s}" label) ""))) - (if (and longtblp caption) "\\\\\n" "\n") + (if (and longtblp caption) "\\\\\n" "\n") (if (and org-export-latex-tables-centered (not longtblp)) "\\begin{center}\n") (if (not longtblp) @@ -1993,6 +1993,12 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (if (not longtblp) (format "\n\\end{%s}" tabular-env)) (if longtblp "\n" (if org-export-latex-tables-centered "\n\\end{center}\n" "\n")) + (if (and floatp (not org-export-latex-table-caption-above)) + (format + "\\caption%s{%s} %s" + (if shortn (concat "[" shortn "]") "") + (or caption "") + (if label (format "\\label{%s}" label) ""))) (if longtblp "\\end{longtable}" (if floatp (format "\\end{%s}" tblenv))))) @@ -2042,11 +2048,12 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (setq tbl (concat "\\begin{center}\n" tbl "\\end{center}"))) (when floatp (setq tbl (concat "\\begin{table}\n" + (if (not org-export-latex-table-caption-above) tbl) (format "\\caption%s{%s%s}\n" (if shortn (format "[%s]" shortn) "") (if label (format "\\label{%s}" label) "") (or caption "")) - tbl + (if org-export-latex-table-caption-above tbl) "\n\\end{table}\n"))) (insert (org-export-latex-protect-string tbl)))) -- 1.7.1