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 <n.goaz...@gmail.com>
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 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index f3a55ee..b9255c1 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1675,9 +1675,10 @@ The conversion is made depending of STRING-BEFORE and 
STRING-AFTER."
                           (if floatp "\\begin{table}[htb]\n"))
                         (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")
@@ -1749,7 +1750,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 ""))
-- 
1.7.2

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to