* bug in org-mode-export-as-latex
@ 2010-07-28 14:31 Neil Hepburn
2010-07-28 18:59 ` [PATCH] " Nicolas Goaziou
0 siblings, 1 reply; 3+ messages in thread
From: Neil Hepburn @ 2010-07-28 14:31 UTC (permalink / raw)
To: emacs-orgmode
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. The following
code in an org-mode file
#+CAPTION: A Simple Table
#+LABEL: tbl:ATbl
|----------+----------|
| column 1 | column 2 |
|----------+----------|
| thing | one |
| thing | two |
|----------+----------|
leads to this in the LaTeX file
\begin{table}[htb]
\caption{A Simple Table}
\begin{center}
\begin{tabular}{ll}
\hline
column 1 & column 2 \\
\hline
thing & one \\
thing & two \\
\hline
\end{tabular}
\end{center}
\end{table}
Note the missing \label{} command in the LaTeX version. I rolled back to
version 6.34c and everything works.
Cheers,
Neil
======================================================
Neil Hepburn, Economics Lecturer
Department of Social Sciences, Augustana Faculty
the University of Alberta
Camrose, Alberta
Phone: 780.679.1588
email: nhepburn@ualberta.ca
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bug in org-mode-export-as-latex
2010-07-28 14:31 bug in org-mode-export-as-latex Neil Hepburn
@ 2010-07-28 18:59 ` Nicolas Goaziou
2010-07-31 17:00 ` Patchwork: Patch 177 Accepted Bastien Guerry
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2010-07-28 18:59 UTC (permalink / raw)
To: Neil Hepburn; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 370 bytes --]
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
[-- Attachment #2: 0001-Add-labels-to-tables.patch --]
[-- Type: text/plain, Size: 1727 bytes --]
From 64855c52b20766db9898ce82316fac11d51de72d Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@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
[-- Attachment #3: Type: text/plain, Size: 201 bytes --]
_______________________________________________
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Patchwork: Patch 177 Accepted
2010-07-28 18:59 ` [PATCH] " Nicolas Goaziou
@ 2010-07-31 17:00 ` Bastien Guerry
0 siblings, 0 replies; 3+ messages in thread
From: Bastien Guerry @ 2010-07-31 17:00 UTC (permalink / raw)
To: emacs-orgmode
Patch 177 (http://patchwork.newartisans.com/patch/177/) is now Accepted.
This relates to the following submission:
http://mid.gmane.org/%3C8739v3o2jl.wl%25n.goaziou%40gmail.com%3E
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-31 17:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28 14:31 bug in org-mode-export-as-latex Neil Hepburn
2010-07-28 18:59 ` [PATCH] " Nicolas Goaziou
2010-07-31 17:00 ` Patchwork: Patch 177 Accepted Bastien Guerry
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).