Mosè Giordano writes:
I like org, and I used it in the past (nowadays much less), and
its table features are really impressive. In particular I love
the possibility to turn Emacs into a full fledged spreadsheet
combining org and calc. Nevertheless, I don't like very much
the final LaTeX output of org tables (I don't know if it changed
lately, but looking to your screenshot it doesn't seem to be
so), for example the vertical bars are questionable, but of
course in Emacs you can customize every detail and the content
of of the table is more important of its aspect that can be
easily adjusted.
The vertical lines are not default. But yes, everything can be
easily configured. For example to use booktabs, you can use
something like:
#+BEGIN_SRC emacs-lisp
(defun orgtbl-to-latex-booktabs (table params)
"Convert the Orgtbl mode TABLE to LaTeX using booktabs
package."
(let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
org-table-last-alignment ""))
(params2
(list
:tstart (concat "\\begin{tabular}{" alignment
"}\n\\toprule")
:tend "\\bottomrule\n\\end{tabular}"
:lstart "" :lend " \\\\" :sep " & "
:efmt "%s\\,(%s)" :hline "\\midrule")))
(orgtbl-to-generic table (org-combine-plists params2
params))))
(eval-after-load "org-table"
'(progn
(setq orgtbl-radio-table-templates
(delete-if (lambda (x) (equal (car x) 'latex-mode))
orgtbl-radio-table-templates))
(add-to-list 'orgtbl-radio-table-templates
'(latex-mode "% BEGIN RECEIVE ORGTBL %n\n% END
RECEIVE ORGTBL %n\n\\begin{comment}\n#+ORGTBL:
SEND %n orgtbl-to-latex-booktabs :splice nil
:skip 0 :no-escape t\n| |
|\n\\end{comment}\n"))))
#+END_SRC
Then orgtbl-insert-radio-table, puts something like:
% BEGIN RECEIVE ORGTBL the-name-of-the-table
% END RECEIVE ORGTBL the-name-of-the-table
\begin{comment}
#+ORGTBL: SEND the-name-of-the-table orgtbl-to-latex-booktabs
:splice nil :skip 0 :no-escape t
| | |
\end{comment}
and a table like:
| A | B |
|---+---|
| a | b |
| 1 | 2 |
gets translated to:
\begin{tabular}{ll}
\toprule
A & B \\
\midrule
a & b \\
1 & 2 \\
\bottomrule
\end{tabular}
--
Jorge.
_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex