From: Vikas Rawal <vikaslists@agrarianresearch.org>
To: John Hendy <jw.hendy@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: orgmod: R and threeparttable
Date: Fri, 13 Dec 2013 08:07:37 +0100 [thread overview]
Message-ID: <CAFVt51JW0d-t0ggtGsYFXLXXVLRM5q0WWFSJMq5eXo=ZPVM-pg@mail.gmail.com> (raw)
In-Reply-To: <CA+M2ft84QnnnpzDFnErEvYct7NprNo45=8O5=-3dQt70YJwxig@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3480 bytes --]
Thanks very much, John. I have been trying something of this kind without
much success. Will try to take your code, and work with it.
In the meanwhile, this is really calling for a neat implementation.
Can we have it somewhere marked as TODO?
Vikas
On Wed, Dec 11, 2013 at 9:43 PM, John Hendy <jw.hendy@gmail.com> wrote:
> On Wed, Dec 11, 2013 at 5:12 AM, Vikas Rawal
> <vikaslists@agrarianresearch.org> wrote:
> > What is the best solution for the following scenario?
> >
> > In my org file, I use an R source code to generate a table. I would
> like to
> > additionally specify notes to this table, and use threeparttable in latex
> > export to be able to specify notes below the table.
> >
> > Can somebody point me to an example on how could this be done best?
>
> I fiddled with this a little out of curiosity, and I'm not sure it's
> going to work with the current #+attr_latex abilities. Someone more
> familiar could correct me, though! I think the issue is that the
> structure needs to be something like this:[1]
>
> ==========
>
> \begin{threeparttable}
> \begin{tabular}{c c c c}
> \toprule
> \textbf{1st Column} & \textbf{2nd Colimn} & \textbf{3rd Colimn} &
> \textbf{4th Colimn} \\ \midrule
> QWERTY\tnote{1} & & & \\
> ASDFGH\tnote{2} & & &
> \\ \bottomrule
> \end{tabular}
> \begin{tablenotes}
> \item[1] qwerty; \item[2] asdfgh
> \end{tablenotes}
> \end{threeparttable}
> ==========
>
> [1] Taken from:
> http://tex.stackexchange.com/questions/118743/threeparttable-notes-layout
>
> But Org, I believe, can only wrap stuff in one \begin/end{} pair. So,
> naively, I tried:
>
> #+begin_src R :session r :exports results :results output wrap :eval no
> library(ascii)
>
> options(asciiType = "org")
>
> data <- data.frame(a = 1:5, b = 6:10, c = 11:15)
> cat("#+attr_latex: :environment threeparttable \n")
> ascii(data, include.rownames = F, rownames = F, colnames = names(data))
>
> #+end_src
>
> #+RESULTS:
> :RESULTS:
> #+attr_latex: :environment threeparttable
> | a | b | c |
> |------+-------+-------|
> | 1.00 | 6.00 | 11.00 |
> | 2.00 | 7.00 | 12.00 |
> | 3.00 | 8.00 | 13.00 |
> | 4.00 | 9.00 | 14.00 |
> | 5.00 | 10.00 | 15.00 |
> :END:
>
> It *sort of* works in that I get LaTeX table syntax wrapped with
> \begin/end{threeparttable}, but then I caught that threeparttable is
> actually a wrapper around tabular. Not sure how you can currently use
> Org to specify two layered wrappers like that? Or you might need
> someone to write an equivalent of #+begin/end_center for
> threeparttable?
>
> #+begin_threeparttable
> table-generating-stuff
> #+end_threeparttable
>
> Even more complicate is that tabular ends, then a tablenotes
> environment begins/ends, and only *then* does threeparttable end.
>
> Sorry I couldn't be of more help. I wanted to post anyway so that
> others might better understand how this is supposed to work. In the
> future, I'd highly recommend posting some minimal code so others can
> understand. At the very least, post some minimal LaTeX of the sort you
> want as a result. Even better would be any Org-specific methods tried.
> Otherwise, people scan the email, see threeparttable, have no
> reference for it (like me) and probably just delete.
>
> I happen to be on vacation with plenty of time for digging, so I dug
> for a bit on this.
>
>
> Best regards,
> John
>
> >
> > Vikas
> >
> >
> >
>
[-- Attachment #2: Type: text/html, Size: 4480 bytes --]
next prev parent reply other threads:[~2013-12-13 7:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 11:12 orgmod: R and threeparttable Vikas Rawal
2013-12-11 20:43 ` John Hendy
2013-12-13 7:07 ` Vikas Rawal [this message]
2013-12-14 8:08 ` Vikas Rawal
2013-12-14 8:46 ` Nicolas Goaziou
2013-12-14 9:40 ` Vikas Rawal
2013-12-14 11:04 ` Nicolas Goaziou
2013-12-14 12:06 ` Vikas Rawal
2013-12-14 13:48 ` Vikas Rawal
2013-12-15 9:50 ` Vikas Rawal
2013-12-15 9:55 ` Vikas Rawal
2013-12-15 9:58 ` Nicolas Goaziou
2013-12-15 10:21 ` Vikas Rawal
2013-12-15 10:46 ` Nicolas Goaziou
2013-12-15 10:50 ` Vikas Rawal
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='CAFVt51JW0d-t0ggtGsYFXLXXVLRM5q0WWFSJMq5eXo=ZPVM-pg@mail.gmail.com' \
--to=vikaslists@agrarianresearch.org \
--cc=emacs-orgmode@gnu.org \
--cc=jw.hendy@gmail.com \
/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).