emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: allow table* specification with #+ATTR_LaTeX:
Date: Wed, 15 Dec 2010 14:33:17 -0700	[thread overview]
Message-ID: <8739pyraaq.fsf@cs.unm.edu> (raw)

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

Hi,

The attached patch allows the use of table* latex tables from within Org
mode documents using the attr_latex lines, for example

#+CAPTION: A wide table
#+LABEL: tbl:wide
#+ATTR_LaTeX: table* align=l|lp{3cm}r|l
| ... | ... |
| ... | ... |

Should this be added, or should we put together a more general solution
for different types of table environments?  Currently only longtable is
supported.  Also, is there already a way to do this that I have missed?

Thanks -- Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: wide-tables.patch --]
[-- Type: text/x-diff, Size: 2301 bytes --]

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index a261171..b7f48d3 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1741,7 +1741,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
              (org-table-last-column-widths (copy-sequence
                                             org-table-last-column-widths))
              fnum fields line lines olines gr colgropen line-fmt align
-             caption shortn label attr floatp placement longtblp)
+             caption shortn label attr floatp placement longtblp tblenv)
         (if org-export-latex-tables-verbatim
             (let* ((tbl (concat "\\begin{verbatim}\n" raw-table
                                 "\\end{verbatim}\n")))
@@ -1758,6 +1758,9 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
                          'org-label raw-table)
                   longtblp (and attr (stringp attr)
                                 (string-match "\\<longtable\\>" attr))
+		  tblenv (if (and attr (stringp attr)
+				  (string-match (regexp-quote "table*") attr))
+			     "table*" "table")
                   align (and attr (stringp attr)
                              (string-match "\\<align=\\([^ \t\n\r]+\\)" attr)
                              (match-string 1 attr))
@@ -1821,7 +1824,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
                        (concat
                         (if longtblp
                             (concat "\\begin{longtable}{" align "}\n")
-                          (if floatp (format "\\begin{table}%s\n" placement)))
+                          (if floatp
+			      (format "\\begin{%s}%s\n" tblenv placement)))
                         (if floatp
                             (format
                              "\\caption%s{%s} %s"
@@ -1852,7 +1856,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
                                               "\n\\end{center}\n" "\n"))
                         (if longtblp
                             "\\end{longtable}"
-                          (if floatp "\\end{table}"))))
+                          (if floatp (format "\\end{%s}" tblenv)))))
                       "\n\n"))))))))
 
 (defun org-export-latex-convert-table.el-table ()

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

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

             reply	other threads:[~2010-12-15 21:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 21:33 Eric Schulte [this message]
2010-12-16  4:27 ` allow table* specification with #+ATTR_LaTeX: Thomas S. Dye
2010-12-16 13:16   ` Eric Schulte
2010-12-16 14:43     ` Eric Schulte
2010-12-16 15:42       ` Thomas S. Dye
2010-12-17  0:57         ` Eric Schulte
2010-12-17 16:21           ` Thomas S. Dye
2010-12-17 20:39             ` Eric Schulte
2010-12-17 20:44               ` Carsten Dominik
2010-12-17 21:01                 ` Eric Schulte
2010-12-17 21:04                   ` Carsten Dominik
2010-12-18 20:18               ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8739pyraaq.fsf@cs.unm.edu \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).