emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] latex export and booktabs tables


From: Thomas S. Dye
Subject: Re: [Orgmode] latex export and booktabs tables
Date: Tue, 22 Jun 2010 13:03:32 -1000

Aloha Erik,

The rules defined in booktabs work with longtables, if that is what you are asking.

All the best,
Tom

On Jun 22, 2010, at 11:36 AM, Erik Butz wrote:

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

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

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