emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Latex formatting for an extracted table
@ 2019-03-03  2:20 Brett Presnell
  0 siblings, 0 replies; only message in thread
From: Brett Presnell @ 2019-03-03  2:20 UTC (permalink / raw)
  To: emacs-orgmode


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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-03  2:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-03  2:20 Latex formatting for an extracted table Brett Presnell

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).