Re: [O] resize org-table when exporting to latex

2017-02-28 Thread Vicente Vera
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
 :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 :

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


Re: [O] resize org-table when exporting to latex

2017-02-27 Thread Nick Dokos
Jeremie Juste  writes:

> 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?
>

You need to use tabularx - something like this:

--8<---cut here---start->8---
#+LATEX_HEADER: \usepackage{tabularx}

* Export a table

#+CAPTION: foo
#+NAME: bar
#+ATTR_LATEX: :environment tabularx :width .8\textwidth :align X|X|X|X
| a | b | c | d | 
|---+---+---+---|
| 1 | 2 | 3 | 4 |

--8<---cut here---end--->8---

-- 
Nick




[O] resize org-table when exporting to latex

2017-02-27 Thread Jeremie Juste

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