From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: tabularx from org to latex not recognized Date: Sun, 01 May 2016 20:39:05 -0400 Message-ID: <87pot5e1jq.fsf@gmail.com> References: <700165816.12003481462141272553.JavaMail.httpd@webmail-30.iol.local> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ax1tg-0008Rp-GD for emacs-orgmode@gnu.org; Sun, 01 May 2016 20:39:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ax1tU-0007Cc-J7 for emacs-orgmode@gnu.org; Sun, 01 May 2016 20:39:31 -0400 Received: from plane.gmane.org ([80.91.229.3]:46731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ax1tU-0007B4-Bw for emacs-orgmode@gnu.org; Sun, 01 May 2016 20:39:24 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ax1tJ-0002LJ-R2 for emacs-orgmode@gnu.org; Mon, 02 May 2016 02:39:13 +0200 Received: from pool-74-104-149-70.bstnma.fios.verizon.net ([74.104.149.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 May 2016 02:39:13 +0200 Received: from ndokos by pool-74-104-149-70.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 May 2016 02:39:13 +0200 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" To: emacs-orgmode@gnu.org "vendo.libri@libero.it" writes: > Hello Org-mode users' group, > > I'm having trouble with tables, in particular with trying to get Org-mode to understand the attributes in #+ATTR_LATEX. > I have a 7x3 (rows x columns) table that has lots of text in the 2 column. This means I can't properly see the table if Emacs' window is reduced rather than in full-screen view. The rows > and column are all jumbled up. I've read in the Org online manual (section 3.2) that you must type something like where n is an integer so that the column restricts the number of > visible characters in an otherwise overflowing text. I've tried it by placing <10> in the header of the column but it doesn't work. Can someone help me out? > > Furthermore, when I try to get the pdf via LaTeX export (C-c C-e l o), in spite of adding the necessary package to #+LATEX_HEADER and to the add-to-alist within the .emac configuration > file, the table gets exported in a "tabular" environment instead of "tabularx" which allows for adaptable columns. In LaTeX it should be: > > \begin{table}[htb] > \centering > \begin{tabularx}{\textwidth}{lXX} > \toprule > NAME & CHARACTERISTICS & EXAMPLES\\ > [...] > > I've read extensively sec.12.7.5 of the org-manual but I don't know how to get {\textwidth}{lXX} for tabularx recognized by Org-mode. Can someone show me how, with an example specific to > my case? > > Here's some of the preamble from my org file. I've since continued to type the document in LaTeX because the org-exported pdf had an overflowing table that I couldn't control. Can someone > shed some light into all this matter, please? > > #+TITLE: My Title > #+AUTHOR: Me > #+DATE: April 2016 > #+STARTUP: nolatexpreview align > #+OPTIONS: toc:nil > #+LATEX_CLASS: article > #+LATEX_CLASS_OPTIONS: [a4paper,10pt] > #+ATTR_LATEX: :booktabs :environment tabularx :width textwidth :align lXX > [...] > #+LATEX_HEADER: \usepackage{tabularx,booktabs} > #+LATEX_HEADER: \setcounter{secnumdepth}{0} > [...] > > This is how the table appears if I use TAB to hop from one field to the other. > > | NAME | CHARACTERISTICS > | EXAMPLES | > | > -------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------- > | > | Metals | <10> metallic bonding: adjacent atoms share electrons in a non-directional way; opaque, shiny, electrically conductive, they reflect photons, light rays from the > environment | a metal pan | > > Any help is highly appreciated. Thank you. The specification is on a row of its own, in the same column that it is supposed to control. Try the following: --8<---------------cut here---------------start------------->8--- #+ATTR_LATEX: :environment tabularx :width \textwidth :align lXl | NAME | CHARACTERISTICS | EXAMPLES | |--------+----------------------+-------------| | | <20> | | | Metals | metallic bonding: adjacent atoms share electrons in a non-directional way; opaque, shiny, electrically conductive, they reflect photons, light rays from the Qenvironment | a metal pan | --8<---------------cut here---------------end--------------->8--- -- Nick