From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] bug in org-mode-export-as-latex Date: Wed, 28 Jul 2010 20:59:42 +0200 Message-ID: <8739v3o2jl.wl%n.goaziou@gmail.com> References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Wed_Jul_28_20:59:42_2010-1" Return-path: Received: from [140.186.70.92] (port=60678 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeBrI-0006jI-Jc for emacs-orgmode@gnu.org; Wed, 28 Jul 2010 15:00:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeBrG-0006nO-KJ for emacs-orgmode@gnu.org; Wed, 28 Jul 2010 15:00:03 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:45022) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeBrG-0006lp-F2 for emacs-orgmode@gnu.org; Wed, 28 Jul 2010 15:00:02 -0400 Received: by wyg36 with SMTP id 36so5095862wyg.0 for ; Wed, 28 Jul 2010 12:00:00 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Neil Hepburn Cc: emacs-orgmode@gnu.org --Multipart_Wed_Jul_28_20:59:42_2010-1 Content-Type: text/plain; charset=US-ASCII 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 --Multipart_Wed_Jul_28_20:59:42_2010-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="0001-Add-labels-to-tables.patch" Content-Transfer-Encoding: 7bit >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 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 --Multipart_Wed_Jul_28_20:59:42_2010-1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --Multipart_Wed_Jul_28_20:59:42_2010-1--