Re: [O] [PATCH] Add support for `ltablex'

2013-09-04 Thread Francesco Pizzolante


Hi Nicolas,

> What are its advantages over "longtabu" environment, which is already
> supported? There is a lot of table related packages, I'm not sure we
> want to support them all.

I wasn't aware about the tabu package and its tabu and longtabu environments.
I'll try to use it and see if I can get what I want.

One nice thing about ltablex is that you don't need to use different
environments for short or long tables: you still use the well known tabularx
environment in any case.

For now, please ignore my patch unless I come up with issues using the tabu
package.

Thanks a lot for your answer.

Regards,
 Francesco




[O] [PATCH] Add support for `ltablex'

2013-09-03 Thread Francesco Pizzolante
Hello,

Please find here a patch to support the tabularx table environment when used
in conjunction with the ltablex LaTeX package.

ltablex combines the advantages of longtable and tabularx packages: it enables
splitting of table across pages, and have fixed-width tables with
auto-adjusted columns.

Like longtable, it does not require a float table environment around.

I added a ltablex environment name which will be exported as a tabularx LaTeX
environment without a table float environment (this is the exact same behavior
as for longtable).

Usage is the same as tabularx (except that you use ltablex as :environment
name in the ATTR_LATEX specification):

- you need to specify a :width attribute, and
- an :align attribute.

In this case, like for longtable, the :float attribute is also ignored.

Best regards,
 Francesco

* ox-latex.el (org-latex--org-table): Add support for `ltablex'.

From: Francesco Pizzolante 
Date: Tue, 3 Sep 2013 16:44:24 +0200
Subject: [PATCH] Add support for `ltablex'

---
 lisp/ox-latex.el |   17 -
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index e66c717..6af3acf 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2350,7 +2350,7 @@ This function assumes TABLE has `org' as its `:type' 
property and
org-latex-default-table-environment))
 ;; If table is a float, determine environment: table, table*
 ;; or sidewaystable.
-(float-env (unless (member table-env '("longtable" "longtabu"))
+(float-env (unless (member table-env '("longtable" "longtabu" 
"ltablex"))
  (let ((float (plist-get attr :float)))
(cond
 ((and (not float) (plist-member attr :float)) nil)
@@ -2401,6 +2401,21 @@ This function assumes TABLE has `org' as its `:type' 
property and
   (concat caption "\n"))
  "\\end{longtabu}\n"
  (and fontsize "}")))
+ ;; Ltablex (Tabularx without float).
+ ((equal "ltablex" table-env)
+  (concat (and fontsize (concat "{" fontsize))
+ (format "\\begin{tabularx}{%s}{%s}\n"
+ width
+ alignment)
+ (and org-latex-table-caption-above
+  (org-string-nw-p caption)
+  (concat caption "\n"))
+ contents
+ (and (not org-latex-table-caption-above)
+  (org-string-nw-p caption)
+  (concat caption "\n"))
+ "\\end{tabularx}\n"
+ (and fontsize "}")))
  ;; Others.
  (t (concat (cond
 (float-env
--
1.7.9



Re: [O] [PATCH] Add support for `ltablex'

2013-09-03 Thread Nicolas Goaziou


Hello,

Francesco Pizzolante
 writes:

> Please find here a patch to support the tabularx table environment when used
> in conjunction with the ltablex LaTeX package.

Thanks for the patch.

What are its advantages over "longtabu" environment, which is already
supported? There is a lot of table related packages, I'm not sure we
want to support them all.


Regards,

-- 
Nicolas Goaziou