From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: resize table in latex Date: Mon, 1 Jun 2015 18:35:52 +0200 Message-ID: <20150601163552.GF30465@chitra.no-ip.org> References: <1529a4f6-d431-4600-98a5-4910120dcecd@HUB01.ad.oak.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzSh0-0002ay-If for emacs-orgmode@gnu.org; Mon, 01 Jun 2015 12:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzSgy-0007jP-Ue for emacs-orgmode@gnu.org; Mon, 01 Jun 2015 12:36:02 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:37922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzSgy-0007j7-N1 for emacs-orgmode@gnu.org; Mon, 01 Jun 2015 12:36:00 -0400 Received: by wizo1 with SMTP id o1so112528168wiz.1 for ; Mon, 01 Jun 2015 09:35:55 -0700 (PDT) Received: from chitra.no-ip.org ([2001:610:120:3001:2ad2:44ff:fe4a:b029]) by mx.google.com with ESMTPSA id be3sm17422039wib.21.2015.06.01.09.35.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 09:35:54 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1529a4f6-d431-4600-98a5-4910120dcecd@HUB01.ad.oak.ox.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On Mon, Jun 01, 2015 at 10:51:24AM +0000, Zhihao Ding wrote: > Hi there, > > I am trying to find a way to automatically resize tables > in the latex output. > > When doing slides in beamer, I use this to resize tables > to fit in a frame > > #+LaTeX: \scriptsize{\resizebox{\textwidth}{!}{ > | . | . | > #+LaTeX: }} > > While when writing reports, I use the following instead > as I need to cross reference it by the name > > #+CAPTION: table caption > #+NAME: table:label > | . | . | > > then I loose the resize facility. How could I combine > the two? I tried to fiddle with > #+ATTR_LATEX but didn’t mange to make it work. I don't follow. Why do you say you lose the facility? The following: #+LaTeX: \scriptsize{\resizebox{\textwidth}{!}{ #+CAPTION: table caption #+NAME: table:label | . | . | | . | . | #+LaTeX: }} exports as: \scriptsize{\resizebox{\textwidth}{!}{ \begin{table}[htb] \caption{\label{tab:orgtable1} table caption} \centering \begin{tabular}{ll} . & .\\ . & .\\ \end{tabular} \end{table} }} Isn't that exactly what you want? -- Suvayu Open source is the future. It sets us free.