emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Thomas S. Dye" <tsd@tsdye.com>
To: emacs-orgmode@gnu.org
Subject: [babel] noweb expansion of LaTeX output from R
Date: Sun, 1 Nov 2009 11:45:26 -1000	[thread overview]
Message-ID: <059A4FD8-DD27-4438-8032-C93988BCAB65@tsdye.com> (raw)

Aloha all,

Is it possible to use the noweb syntax to pass LaTeX output from R  
into a latex source block?  I thought this would work, but the noweb  
expansion yields nil.

Please note that this is just a question and not a request for a  
change to org-babel.  In this particular case, the best solution for  
my workflow appears to be sending the table to a file, where I can  
tweak the results more easily and completely than I can using the  
facilities of the xtable package in R.

It does seem like a potentially useful path, though.

The following source and results blocks illustrate the situation, but  
won't run unless you have a whole.adze object in the R session.  If  
need be, I can supply an example that will stand alone.

All the best,
Tom

#+begin_src latex
  Here is the output of the quantile
   function: <<r-weight-quantile()>>.
#+end_src

#+srcname: r-weight-quantile
#+begin_src R :session :noweb :results output
  library(xtable)
  weight <- quantile(whole.adze$weight)
  xtable(as.data.frame(weight))
#+end_src

#+resname: r-weight-quantile
#+begin_example
% latex table generated in R 2.9.2 by xtable 1.5-5 package
% Sun Nov  1 11:17:44 2009
\begin{table}[ht]
\begin{center}
\begin{tabular}{rr}
   \hline
  & weight \\
   \hline
0\% &   0 \\
   25\% &  22 \\
   50\% &  34 \\
   75\% &  83 \\
   100\% & 2580 \\
    \hline
\end{tabular}
\end{center}
\end{table}
#+end_example

             reply	other threads:[~2009-11-01 21:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-01 21:45 Thomas S. Dye [this message]
2009-11-01 22:24 ` [babel] noweb expansion of LaTeX output from R Dan Davison
     [not found]   ` <4A5A0920-3560-40A2-BC17-67198796720D@tsdye.com>
     [not found]     ` <87aaz5q0c5.fsf@stats.ox.ac.uk>
2009-11-02  2:59       ` Thomas S. Dye
2009-11-02  3:36       ` Thomas S. Dye
2009-11-02  6:08         ` Dan Davison

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=059A4FD8-DD27-4438-8032-C93988BCAB65@tsdye.com \
    --to=tsd@tsdye.com \
    --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).