emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] latex export and booktabs tables


From: Erik Butz
Subject: [Orgmode] latex export and booktabs tables
Date: Tue, 22 Jun 2010 23:36:00 +0200

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 via email to

[Prev in Thread] Current Thread [Next in Thread]