From caa5da1efdd79d5984405e6f109eaaca44eac88f Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 28 Jul 2010 23:59:42 +0000 Subject: [PATCH] bug in org-mode-export-as-latex Hello, >>>>> Neil Hepburn writes: > The latest version (7.01g) seems to have a bug when exporting to PDF > (and LaTeX) with tables with labels. The export does not label the > table in the LaTeX file although it is labeled in the .org file. Curiously, it looks like \label code was removed at some time. This quick fix should put labels back. Regards, -- Nicolas >From 64855c52b20766db9898ce82316fac11d51de72d Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 28 Jul 2010 20:54:40 +0200 Subject: [PATCH] Add labels to tables. * org-latex.el (org-export-latex-tables): add label if any * org-latex.el (org-export-latex-convert-table.el-table): fix little mistake when inserting label --- lisp/org-latex.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 74af57af6..056f1b38d 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1680,9 +1680,10 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (if floatp (format "\\begin{table}%s\n" placement))) (if floatp (format - "\\caption%s{%s}" + "\\caption%s{%s} %s" (if shortn (concat "[" shortn "]") "") - (or caption ""))) + (or caption "") + (when label (format "\\label{%s}" label)))) (if (and longtblp caption) "\\\\\n" "\n") (if (and org-export-latex-tables-centered (not longtblp)) "\\begin{center}\n") @@ -1754,7 +1755,7 @@ 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" - (format "\\caption%s{%s%s}\n" + (format "\\caption%s{%s}%s\n" (if shortn (format "[%s]" shortn) "") (if label (format "\\label{%s}" label) "") (or caption ""))