From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kai Subject: Are there better ways to export wide LaTeX tables/figures? Date: Wed, 08 Dec 2010 21:08:01 -0500 Message-ID: <4D003A01.2030802@limist.com> References: <20101208142507.D67F6C400B0@mx8.webfaction.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=55478 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQVvS-0007m0-2k for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 21:08:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQVvQ-0005AY-QM for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 21:08:05 -0500 Received: from mail6.webfaction.com ([74.55.86.74]:36405 helo=smtp.webfaction.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQVvQ-0005AO-M8 for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 21:08:04 -0500 Received: from [192.168.1.2] (c-24-63-132-141.hsd1.ma.comcast.net [24.63.132.141]) by smtp.webfaction.com (Postfix) with ESMTP id 82AF8412820 for ; Wed, 8 Dec 2010 20:08:02 -0600 (CST) In-Reply-To: <20101208142507.D67F6C400B0@mx8.webfaction.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi all, After spending a few hours experimenting with orgmode's exporting of tables to LaTeX, I've got three problems to do with wide tables/figures, which I'm hoping have smarter solutions that what I could find: 1) When one has a table of even moderate width it will "run off the page" by default when exported to LaTeX and then pdf-published, since by default LaTeX will not automatically fit the column sizes to the page width, nor wrap text within cells to fit. As far as I can tell, within orgmode, one has to do manual tweaking in the +ATTR_LaTeX line of the table like: #+ATTR_LaTeX: tabular width=\textwidth align=|p{1.8cm}|p{1.5cm}|p{1.5cm}|p{1.3cm}| ...and set the column widths manually (in the example above, manually set four column widths). Is there a better way to do this from within orgmode? 2) Now after one does all that hand-tweaking and trial and error of setting the LaTeX table column widths manually, the printed table may finally fit on the page, BUT still be wider than \textwidth, and appear off-center (it will be aligned on the left, but extend past the right margin). I found this technique of centering the over-wide table/figure using \makebox: http://texblog.net/latex-archive/layout/centering-figure-table/ ...which basically involves wrapping the LaTeX table code with "\noindent\makebox[\textwidth]{%" and a closing curly brace, "}". But I could not find a way to specify that within orgmode; if I have something like the following it will not work, the table does not end up being exported: #+LaTeX: \noindent\makebox[\textwidth]{% #+CAPTION: A wide table. #+LABEL: tbl:wide_table #+ATTR_LaTeX: tabular width=\textwidth align=|p{1.8cm}|p{1.5cm}|p{1.5cm}|p{1.3cm}|p{2cm}|p{2.25cm}|p{1.7cm}| | Technology | Stack Efficiency | System Efficiency | Lifetime [years] | Degradation [microV/h] | Estimated High-volume manufacturing cost [2007 Euros/kW] | Target Sale Price [2007 Euros/kW] | |------------+------------------+-------------------+------------------+------------------------+----------------------------------------------------------+-----------------------------------| | AFC | 0.43-0.5 | 0.27-0.32 | 0.5-1.1 | 10-30 | 325-675 | 120-230 | #+LaTeX: %} Is there any way to specify from the orgmode file that the (too wide) exported LaTeX table should be absolutely centered in the page, so as to avoid manual fixes per table in the tex file after exporting? Same question applies to large images that one wants wider than \textwidth, yet centered within the page - is there a way to do it cleanly? 3) Finally, is there a way to specify a smaller text size for tables consistently? e.g. within the exported LaTex file, one could manually specify \footnotesize table text like: \begin{table}[htb]\footnotesize But is there a way to specify that from orgmode, and avoid post-export manual fixes in the tex file? Thanks in advance, any and all help appreciated! K