From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: [PATCH] org-e-latex: Tables get correct amount of vertical space Date: Tue, 13 Nov 2012 14:29:21 +0000 Message-ID: <87d2zhr2ym.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYHUS-0000h0-1C for emacs-orgmode@gnu.org; Tue, 13 Nov 2012 09:29:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYHUO-0006rX-Vm for emacs-orgmode@gnu.org; Tue, 13 Nov 2012 09:29:23 -0500 Received: from mail-wg0-f49.google.com ([74.125.82.49]:55291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYHUO-0006rI-P5 for emacs-orgmode@gnu.org; Tue, 13 Nov 2012 09:29:20 -0500 Received: by mail-wg0-f49.google.com with SMTP id gg4so3541393wgb.30 for ; Tue, 13 Nov 2012 06:29:19 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Hi, This patch replaces every occurence of the \begin{center} environment with \centering in the file contrib/lisp/org-e-latex.el. I have tested the export of a basic table and it works but not sure if all the replacements are correct. ( BTW, this issue came to light using the nag package like this: \RequirePackage[l2tabu, orthodox]{nag} ) Myles >From 54ae2245978fa755cd5daa483616ffdfa3e5ed0f Mon Sep 17 00:00:00 2001 From: Myles English Date: Tue, 13 Nov 2012 14:14:56 +0000 Subject: [PATCH] org-e-latex: Tables get correct amount of vertical space * contrib/lisp/org-e-latex.el: Replaced \begin{center} ..\end{center} environments with \centering declarations. Using both \begin{table} and \being{center} environments leads to double the vertical space around the float, whereas \centering adds none. TINYCHANGE --- contrib/lisp/org-e-latex.el | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el index 165beb3..c268c2c 100644 --- a/contrib/lisp/org-e-latex.el +++ b/contrib/lisp/org-e-latex.el @@ -550,14 +550,13 @@ in order to mimic default behaviour: \(when tags \(format \"\\\\hfill{}\\\\textsc{:%s:}\" \(mapconcat 'identity tags \":\"))))) - \(format (concat \"\\\\begin{center}\\n\" + \(format (concat \"\\\\centering\\n\" \"\\\\fbox{\\n\" \"\\\\begin{minipage}[c]{.6\\\\textwidth}\\n\" \"%s\\n\\n\" \"\\\\rule[.8em]{\\\\textwidth}{2pt}\\n\\n\" \"%s\" - \"\\\\end{minipage}}\" - \"\\\\end{center}\") + \"\\\\end{minipage}}\") full-title contents))" :group 'org-export-e-latex :type 'function) @@ -1086,7 +1085,7 @@ CONTENTS holds the contents of the center block. INFO is a plist holding contextual information." (org-e-latex--wrap-label center-block - (format "\\begin{center}\n%s\\end{center}" contents))) + (format "\\centering\n%s" contents))) ;;;; Clock @@ -1508,15 +1507,14 @@ holding contextual information." title (when tags (format "\\hfill{}\\textsc{:%s:}" (mapconcat 'identity tags ":")))))) - (format (concat "\\begin{center}\n" + (format (concat "\\centering\n" "\\fbox{\n" "\\begin{minipage}[c]{.6\\textwidth}\n" "%s\n\n" "\\rule[.8em]{\\textwidth}{2pt}\n\n" "%s" "\\end{minipage}\n" - "}\n" - "\\end{center}") + "}") full-title contents)))))) @@ -2302,14 +2300,13 @@ This function assumes TABLE has `org' as its `:type' attribute." (concat (format "\\begin{%s}%s\n" float-env placement) (if org-e-latex-table-caption-above caption ""))) - (when org-e-latex-tables-centered "\\begin{center}\n") + (when org-e-latex-tables-centered "\\centering\n") (format "\\begin{%s}%s{%s}\n%s\\end{%s}" table-env (if width (format "{%s}" width) "") alignment contents table-env) - (when org-e-latex-tables-centered "\n\\end{center}") (when float-env (concat (if org-e-latex-table-caption-above "" caption) (format "\n\\end{%s}" float-env)))))))) @@ -2351,7 +2348,7 @@ attribute." (unless (= n 2) (setq output (replace-match "" nil nil output))))))) (if (not org-e-latex-tables-centered) output - (format "\\begin{center}\n%s\n\\end{center}" output)))) + (format "\\centering\n%s" output)))) ;;;; Table Cell -- 1.8.0