From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Butz Subject: latex export and booktabs tables Date: Tue, 22 Jun 2010 23:36:00 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from [140.186.70.92] (port=57735 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORB8Y-0008VO-AI for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 17:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORB8T-0000uL-Gj for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 17:36:06 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:47970) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORB8T-0000uE-AZ for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 17:36:01 -0400 Received: by bwz4 with SMTP id 4so2048318bwz.0 for ; Tue, 22 Jun 2010 14:36:00 -0700 (PDT) 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: emacs-orgmode@gnu.org Hi all, I found a very old thread on the list about using the booktabs package to have nicer tables in latex export. I found that, making the changes below I can use the booktab package to export tables, and using standard tables only, this seems to work fine. Can anyone advice on whether this kind of change is meaningful or if this is likely to introduce difficulties elsewhere which I did not experience due to the limited scope of usage? It should be said that I did not at all look into longtables so far. Cheers, Erik diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 01a4b05..31ceba4 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1658,7 +1658,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (if (and longtblp caption) "\\\\\n" "\n") (if (and org-export-latex-tables-centered (not longtblp)) "\\begin{center}\n") - (if (not longtblp) (concat "\\begin{tabular}{" align "}\n")) + (if (not longtblp) (concat "\\begin{tabular}{" align "}\n\\toprule\n")) (orgtbl-to-latex lines `(:tstart nil :tend nil @@ -1670,7 +1670,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." \\endfoot \\endlastfoot" (length org-table-last-alignment)) nil))) - (if (not longtblp) (concat "\n\\end{tabular}")) + (if (not longtblp) (concat "\n\\bottomrule\n\\end{tabular}")) (if longtblp "\n" (if org-export-latex-tables-centered "\n\\end{center}\n" "\n")) (if longtblp diff --git a/lisp/org-table.el b/lisp/org-table.el index 46efc28..130ccf2 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -4222,7 +4222,7 @@ this function is called." :tstart (concat "\\begin{tabular}{" alignment "}") :tend "\\end{tabular}" :lstart "" :lend " \\\\" :sep " & " - :efmt "%s\\,(%s)" :hline "\\hline"))) + :efmt "%s\\,(%s)" :hline "\\midrule"))) (orgtbl-to-generic table (org-combine-plists params2 params)))) (defun orgtbl-to-html (table params) diff --git a/lisp/org.el b/lisp/org.el index 2628152..ed6dabe 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3087,6 +3087,7 @@ will be appended." ("" "wasysym" t) ("" "latexsym" t) ("" "amssymb" t) + ("" "booktabs" t) ("" "hyperref" nil) "\\tolerance=1000" )