emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: Andreas Leha <andreas.leha@med.uni-goettingen.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] LaTeX export: added support for sidewaystable from the rotating package
Date: Thu, 15 Mar 2012 08:31:28 -0500	[thread overview]
Message-ID: <CA+M2ft_ADvST3TZpYQdm0KBBnyYcLffEuLGjxfmbf++Wzfs-kg@mail.gmail.com> (raw)
In-Reply-To: <871uoumdhe.fsf@med.uni-goettingen.de>

On Thu, Mar 15, 2012 at 4:15 AM, Andreas Leha
<andreas.leha@med.uni-goettingen.de> wrote:
> Hi all,
>
> below you find a small patch that allows to use sidewaystable during
> latex export, i.e. this file should export as expected:
>
> ,----[ test.org ]
> | * Test sidewaystable
> |
> |   #+CAPTION: A sideways table
> |   #+ATTR_LaTeX: sidewaystable
> |   | The     | header |
> |   |---------+--------|
> |   | entries | here   |
> |
> | * LaTeX Options                                                          :noexport:
> | #+LATEX_HEADER: \usepackage{rotating}
> `----

Cool. I use this on occasion and found that this also works (assuming
you have \usepackage{rotating}, as you show):

-----
#+latex: \begin{sidewaystable}
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |
#+latex: \end{sidewaystable}
-----

Thanks!
John

>
> This is a patch for the "old" LaTeX exporter.  Still, it might lead to
> cleaner documents for somebody.
>
> Cheers,
> Andreas
>
>
> ---
>  lisp/org-latex.el |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/lisp/org-latex.el b/lisp/org-latex.el
> index 03664b4..aec4f1d 100644
> --- a/lisp/org-latex.el
> +++ b/lisp/org-latex.el
> @@ -1917,10 +1917,14 @@ 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)
> -                                 (or (string-match (regexp-quote "table*") attr)
> -                                     (string-match "\\<multicolumn\\>" attr)))
> -                            "table*" "table")
> +                 tblenv (if (and attr (stringp attr))
> +                            (cond ((string-match "\\<sidewaystable\\>" attr)
> +                                   "sidewaystable")
> +                                  ((or (string-match (regexp-quote "table*") attr)
> +                                       (string-match "\\<multicolumn\\>" attr))
> +                                   "table*")
> +                                  (t "table"))
> +                          "table")
>                  tabular-env
>                  (if (and attr (stringp attr)
>                           (string-match "\\(tabular.\\)" attr))
> --
> 1.7.9.1
>
>
>

  reply	other threads:[~2012-03-15 13:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15  9:15 Andreas Leha
2012-03-15 13:31 ` John Hendy [this message]
2012-03-20  1:58 ` Bastien

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=CA+M2ft_ADvST3TZpYQdm0KBBnyYcLffEuLGjxfmbf++Wzfs-kg@mail.gmail.com \
    --to=jw.hendy@gmail.com \
    --cc=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH] LaTeX export: added support for sidewaystable from the rotating package' \
    /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

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