emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Myles English <mylesenglish@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Cc: Andreas Leha <andreas.leha@med.uni-goettingen.de>
Subject: [PATCH] org-e-latex: Fixes bug introduced by commit 907110e
Date: Sat, 17 Nov 2012 15:25:24 +0000	[thread overview]
Message-ID: <87y5i0b6aj.fsf@gmail.com> (raw)


Fixes bug reported to the mailing list with "[O] [BUG] centering export
of babel results".

From e9e99b22d814c1272475f30e4bc7543cc46603f4 Mon Sep 17 00:00:00 2001
From: Myles English <mylesenglish@gmail.com>
Date: Sat, 17 Nov 2012 15:18:16 +0000
Subject: [PATCH] org-e-latex: Fixes bug introduced by commit 907110e

* contrib/lisp/org-e-latex.el: Floating tables get a \centering
  declaration, otherwise the table get wrapped in \begin{center}
  and \end{center} environment.

Thanks to Andreas Leha for reporting it.
---
 contrib/lisp/org-e-latex.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el
index 41513a1..d74c30a 100644
--- a/contrib/lisp/org-e-latex.el
+++ b/contrib/lisp/org-e-latex.el
@@ -2302,20 +2302,22 @@ This function assumes TABLE has `org' as its `:type' attribute."
        (if (or org-e-latex-table-caption-above (string= "" caption)) ""
 	 (concat (org-trim caption) "\\\\\n"))))
      ;; Others.
-     (t (concat (when float-env
+     (t (concat (if float-env
 		  (concat
 		   (format "\\begin{%s}%s\n" float-env placement)
-		   (if org-e-latex-table-caption-above caption "")))
-		(when org-e-latex-tables-centered "\\centering\n")
+		   (if org-e-latex-table-caption-above caption "")
+		   (when org-e-latex-tables-centered "\\centering\n"))
+		  (when org-e-latex-tables-centered "\\begin{center}\n"))
 		(format "\\begin{%s}%s{%s}\n%s\\end{%s}"
 			table-env
 			(if width (format "{%s}" width) "")
 			alignment
 			contents
 			table-env)
-		(when float-env
+		(if float-env
 		  (concat (if org-e-latex-table-caption-above "" caption)
-			  (format "\n\\end{%s}" float-env))))))))
+			  (format "\n\\end{%s}" float-env))
+		  (when org-e-latex-tables-centered "\n\\end{center}")))))))
 
 (defun org-e-latex-table--table.el-table (table contents info)
   "Return appropriate LaTeX code for a table.el table.
-- 
1.8.0

             reply	other threads:[~2012-11-17 15:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-17 15:25 Myles English [this message]
2012-11-17 15:32 ` [PATCH] org-e-latex: Fixes bug introduced by commit 907110e Myles English
2012-11-17 15:46   ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y5i0b6aj.fsf@gmail.com \
    --to=mylesenglish@gmail.com \
    --cc=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).