emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* latex export and booktabs tables
@ 2010-06-22 21:36 Erik Butz
  2010-06-22 23:03 ` Thomas S. Dye
  2010-06-23  8:23 ` Sébastien Vauban
  0 siblings, 2 replies; 13+ messages in thread
From: Erik Butz @ 2010-06-22 21:36 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-06-30 18:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-22 21:36 latex export and booktabs tables Erik Butz
2010-06-22 23:03 ` 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

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