emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [patch] bring back the "multiline" option for latex tables
@ 2011-06-01 16:21 Eric Schulte
  2011-06-13 21:10 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Schulte @ 2011-06-01 16:21 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

Hi,

The following patch make the behavior of LaTeX table exporter more
closely resemble the documented behavior (at least to my mind).  I'm
hesitant to apply this patch myself as it applies to org-latex.el which
is outside of my area of expertise.

Please apply this if it looks reasonable.

Thanks -- Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-replacing-the-multicolumn-option-for-latex-tables.patch --]
[-- Type: text/x-diff, Size: 1669 bytes --]

From fc8700f52c2fbfb1ec601e3bbb32c37e38a4cfbb Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Wed, 1 Jun 2011 10:18:34 -0600
Subject: [PATCH] replacing the "multicolumn" option for latex tables

  This brings the behavior inline with the documentation.

* lisp/org-latex.el (org-export-latex-tables): Check for the
  "multiline" option and set the `floatp' option to true when
  multicolumn tables are requested.
---
 lisp/org-latex.el |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index e2c74ae..0d64f68 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1838,7 +1838,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
                   longtblp (and attr (stringp attr)
                                 (string-match "\\<longtable\\>" attr))
 		  tblenv (if (and attr (stringp attr)
-				  (string-match (regexp-quote "table*") attr))
+				  (or (string-match (regexp-quote "table*") attr)
+				      (string-match "\\<multicolumn\\>" attr)))
 			     "table*" "table")
 		  tabular-env
 		  (if (and attr (stringp attr)
@@ -1851,7 +1852,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
                   align (and attr (stringp attr)
                              (string-match "\\<align=\\([^ \t\n\r]+\\)" attr)
                              (match-string 1 attr))
-                  floatp (or caption label)
+                  floatp (or caption label (string= "table*" tblenv))
 		  placement     (if (and attr
 					 (stringp attr)
 					 (string-match "[ \t]*\\<placement=\\(\\S-+\\)" attr))
-- 
1.7.4.1


[-- Attachment #3: Type: text/plain, Size: 47 bytes --]


-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

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

* Re: [patch] bring back the "multiline" option for latex tables
  2011-06-01 16:21 [patch] bring back the "multiline" option for latex tables Eric Schulte
@ 2011-06-13 21:10 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2011-06-13 21:10 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode

If there are no objections I'm going to apply this patch.  It is
relatively small so hopefully any new bugs should be easily
identifiable.

Best -- Eric

Eric Schulte <schulte.eric@gmail.com> writes:

> Hi,
>
> The following patch make the behavior of LaTeX table exporter more
> closely resemble the documented behavior (at least to my mind).  I'm
> hesitant to apply this patch myself as it applies to org-latex.el which
> is outside of my area of expertise.
>
> Please apply this if it looks reasonable.
>
> Thanks -- Eric
>
>
> From fc8700f52c2fbfb1ec601e3bbb32c37e38a4cfbb Mon Sep 17 00:00:00 2001
> From: Eric Schulte <schulte.eric@gmail.com>
> Date: Wed, 1 Jun 2011 10:18:34 -0600
> Subject: [PATCH] replacing the "multicolumn" option for latex tables
>
>   This brings the behavior inline with the documentation.
>
> * lisp/org-latex.el (org-export-latex-tables): Check for the
>   "multiline" option and set the `floatp' option to true when
>   multicolumn tables are requested.
> ---
>  lisp/org-latex.el |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/org-latex.el b/lisp/org-latex.el
> index e2c74ae..0d64f68 100644
> --- a/lisp/org-latex.el
> +++ b/lisp/org-latex.el
> @@ -1838,7 +1838,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
>                    longtblp (and attr (stringp attr)
>                                  (string-match "\\<longtable\\>" attr))
>  		  tblenv (if (and attr (stringp attr)
> -				  (string-match (regexp-quote "table*") attr))
> +				  (or (string-match (regexp-quote "table*") attr)
> +				      (string-match "\\<multicolumn\\>" attr)))
>  			     "table*" "table")
>  		  tabular-env
>  		  (if (and attr (stringp attr)
> @@ -1851,7 +1852,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
>                    align (and attr (stringp attr)
>                               (string-match "\\<align=\\([^ \t\n\r]+\\)" attr)
>                               (match-string 1 attr))
> -                  floatp (or caption label)
> +                  floatp (or caption label (string= "table*" tblenv))
>  		  placement     (if (and attr
>  					 (stringp attr)
>  					 (string-match "[ \t]*\\<placement=\\(\\S-+\\)" attr))
> -- 
> 1.7.4.1

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

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

end of thread, other threads:[~2011-06-13 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01 16:21 [patch] bring back the "multiline" option for latex tables Eric Schulte
2011-06-13 21:10 ` Eric Schulte

Code repositories for project(s) associated with this 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).