From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: LaTeX table formatting Date: Tue, 28 Aug 2012 14:03:27 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6R4W-0001oc-MQ for emacs-orgmode@gnu.org; Tue, 28 Aug 2012 15:03:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6R4S-0008Hf-A1 for emacs-orgmode@gnu.org; Tue, 28 Aug 2012 15:03:32 -0400 Received: from mail-vc0-f169.google.com ([209.85.220.169]:45344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6R4S-0008HZ-5b for emacs-orgmode@gnu.org; Tue, 28 Aug 2012 15:03:28 -0400 Received: by vcbfl13 with SMTP id fl13so14488vcb.0 for ; Tue, 28 Aug 2012 12:03:27 -0700 (PDT) In-Reply-To: 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: Neuwirth Erich Cc: "emacs-orgmode@gnu.org emacs-orgmode@gnu.org" On Tue, Aug 28, 2012 at 1:10 PM, Neuwirth Erich wrote: > I would like to add some twists to tables. > Using the ATTR_LaTeX attribute I can control > alignment and vertical gridlines in the table. > I also would like to have horizontal gridlines, > and I would like to have multicol top headers. > tgroupt and n.tgroup in theory should me give these multicol headers, > but it does not work. I didn't think Org tables supported multicol/multirow. After searching a bit... does this help? - http://www.gnu.org/software/emacs/manual/html_node/org/A-LaTeX-example.html For \hlines, you need dashed sep between all rows. Like so: | | | *mean* | | *se* | | | year | gender | m1 | m2 | s1 | s2 | |------+--------+--------+-----+------+------| | 2000 | f | 1.0 | 4.6 | 1.00 | 1.50 | |------+--------+--------+-----+------+------| | 2003 | m | 1.1 | 4.7 | 1.14 | 1.64 | |------+--------+--------+-----+------+------| | 2006 | f | 1.2 | 4.7 | 1.29 | 1.79 | |------+--------+--------+-----+------+------| John > > Is there a way of accomplishing what I want? > > > > > #+title: Testing R table output > #+author: Erich Neuwirth > #+date: 28. August 2012 > > #+ATTR_LaTeX: align=|l|c|r|r|r|r| > #+ATTR_HTML: border="2" rules="all" frame="border" > #+begin_src R :session *RPisa* :results output org :exports results > require(ascii) > mydf <- data.frame( > year = rep(as.character(rep(seq(2000,2009,3)),each=2)), > gender = rep(c("f","m"),times=2), > m1 = (11:18)/11, > m2 = (102:109)/22, > s1 = seq(1,2,length.out=8), > s2 = seq(1.5,2.5,length.out=8) > ) > > res <- ascii(mydf, > digits=c(0,0,1,1,2,2), > align=c("l","c","r","r","r","r"), > format=c("d","s","f","f","f","f"), > include.rownames=FALSE, > tgroup=c("","mean","se"), > n.tgroup=c(2,2,2)) > > print(res,type="org") > #+end_src > >