From: Brett Presnell <presnell@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: Latex formatting for an extracted table
Date: Sat, 02 Mar 2019 21:20:55 -0500 [thread overview]
Message-ID: <87y35w8zqw.fsf@ufl.edu> (raw)
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.
reply other threads:[~2019-03-03 2:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y35w8zqw.fsf@ufl.edu \
--to=presnell@member.fsf.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).