emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Vicente Vera <vicentemvp@gmail.com>
To: Jeremie Juste <jeremiejuste@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: resize org-table when exporting to latex
Date: Tue, 28 Feb 2017 14:17:20 +0000	[thread overview]
Message-ID: <CAMfbzvAYBCVom_XTo3V0or283Fz3vWP95jWQaJaEtR7fndBfYw@mail.gmail.com> (raw)
In-Reply-To: <87o9xn88s0.fsf@gmail.com>

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

This requires some LaTeX plumbing work. A few tricks:

First, use tabularx as suggested to stretch the columns automatically as
the size of the table changes.

- Use a smaller font size, such as :font \scriptsize
- Enlarge the table horizontally (for example: :width 0.8\paperheight)
- Put the page in landscape with the "pdflscape" package: wrap the table
with "#+BEGIN_landscape ... #+END_landscape" and change :width to
\paperheight
- Use package "graphicx" and wrap the table in "#+LATEX:
\resizebox{0.8\paperheight}{!}{ ... #+LATEX: }" to make the whole table
smaller

An example of the above in Org syntax (remember to call the necessary
packages):

#+BEGIN_landscape
#+ATTR_LATEX: :options [htbp]
#+BEGIN_table
#+BEGIN_center
#+LATEX: \resizebox{0.8\paperheight}{!}{
#+CAPTION: A big table made small
#+BEGIN_threeparttable
#+ATTR_LATEX: :center nil :environment tabularx :width \paperheight :align
XXXXXXXX :font \scriptsize :booktabs t
...
#+ATTR_LATEX: :options [flushleft]
#+BEGIN_tablenotes
\item[] Source: Someone on the Internet.
#+END_tablenotes
#+END_threeparttable
#+LATEX: }
#+END_center
#+END_table
#+END_landscape


2017-02-28 0:21 GMT+00:00 Jeremie Juste <jeremiejuste@gmail.com>:

>
> Hello,
>
> Is there a way to resize latex table when exporting to latex?
> For now my only recourse is to export the latex table copy the latex
> code back to org-mode apply \scalebox.
>
> Do you have a more convenient way in mind?
>
> Best wishes,
>
> Jeremie
>
>
>
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 2039 bytes --]

      parent reply	other threads:[~2017-02-28 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28  0:21 resize org-table when exporting to latex Jeremie Juste
2017-02-28  2:56 ` Nick Dokos
2017-02-28 14:17 ` Vicente Vera [this message]

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=CAMfbzvAYBCVom_XTo3V0or283Fz3vWP95jWQaJaEtR7fndBfYw@mail.gmail.com \
    --to=vicentemvp@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jeremiejuste@gmail.com \
    /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).