emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Erik Butz <erik.butz@googlemail.com>
To: emacs-orgmode@gnu.org
Subject: latex export and booktabs tables
Date: Tue, 22 Jun 2010 23:36:00 +0200	[thread overview]
Message-ID: <AANLkTinpBewqB1hb8FKW6PkBYRa72shCW-4szic26FuE@mail.gmail.com> (raw)

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"
     )

             reply	other threads:[~2010-06-22 21:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22 21:36 Erik Butz [this message]
2010-06-22 23:03 ` latex export and booktabs tables Thomas S. Dye
2010-06-23  8:23 ` Sébastien Vauban
2010-06-28  5:09   ` Eric Schulte
2010-06-28  6:05     ` Carsten Dominik
2010-06-28  8:45       ` Sébastien Vauban
2010-06-28 15:16         ` Eric Schulte
2010-06-28 20:07           ` Erik Butz
2010-06-28 20:14           ` Sébastien Vauban
2010-06-29  8:00     ` Thomas S. Dye
2010-06-29 17:10       ` Eric Schulte
2010-06-30  3:01         ` Thomas S. Dye
2010-06-30 18:54         ` Eric Schulte

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=AANLkTinpBewqB1hb8FKW6PkBYRa72shCW-4szic26FuE@mail.gmail.com \
    --to=erik.butz@googlemail.com \
    --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).