From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brett Presnell Subject: Latex formatting for an extracted table Date: Sat, 02 Mar 2019 21:20:55 -0500 Message-ID: <87y35w8zqw.fsf@ufl.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:38169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0GkN-0008HI-1f for emacs-orgmode@gnu.org; Sat, 02 Mar 2019 21:20:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0GkM-0001E9-8w for emacs-orgmode@gnu.org; Sat, 02 Mar 2019 21:20:59 -0500 Received: from smtp-prod05.osg.ufl.edu ([128.227.74.125]:42418 helo=smtp.ufl.edu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0GkM-0001AM-0d for emacs-orgmode@gnu.org; Sat, 02 Mar 2019 21:20:58 -0500 Received: from nuc (ip68-105-166-22.ga.at.cox.net [68.105.166.22]) (authenticated bits=0) by smtp.ufl.edu (8.14.4/8.14.4/3.0.0) with ESMTP id x232Kthl017250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 2 Mar 2019 21:20:56 -0500 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 I've taken to typing scores and brief comments into an org table when grading my students papers. In order to extract the scores and comments for each individual student, I use orgtbl-aggregate as follows (the student's nickname in this case is assumed to be "tophat", and the table containing all the scores and comments is names "everyone"): #+BEGIN: aggregate :table "everyone" :cols "Last First Exercise Pts Comments" :cond (equal Nickname "tophat") #+END This creates a new table by extracting the Last, First, Exercise, Pts, and Comments columns (with headers) and only the rows with "tophat" in the Nickname column. My problem is that I need to have the following header on each of the individual tables in order for them to print out properly: #+ATTR_LATEX: :environment tabularx :width \textwidth :align lllrX If I start with #+BEGIN: aggregate :table "everyone" :cols "Last First Exercise Pts Comments" :cond (equal Nickname "tophat") #+ATTR_LATEX: :environment tabularx :width \textwidth :align lllrX #+END then C-c C-c causes the table to appear but the ATTR_LATEX line is wiped out. If instead I start with #+ATTR_LATEX: :environment tabularx :width \textwidth :align lllrX #+BEGIN: aggregate :table "everyone" :cols "Last First Exercise Pts Comments" :cond (equal Nickname "tophat") #+END then the #+ATTR_LATEX: line is ignored in exporting. I've been manually pasting the #+ATTR_LATEX: in after extracting the tables, but there must be a better way to do this. Any advice will be appreciated. FWIW, I realize that I probably don't need orgtbl-aggregate for this. Also, my ideal solution would be to auto-generate the sub-tables by looping over the nicknames, simultaneously inserting a section header with the student's name before each sub-table and a "#+LATEX: \newpage" line after. Hints along these lines would be welcome.