emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [babel] noweb expansion of LaTeX output from R


From: Dan Davison
Subject: Re: [Orgmode] [babel] noweb expansion of LaTeX output from R
Date: Sun, 01 Nov 2009 17:24:43 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

"Thomas S. Dye" <address@hidden> writes:

> 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

Hi Tom,

Do you get the behaviour you want if you change that to 
':results output latex'?

Dan


>
> #+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
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

[Prev in Thread] Current Thread [Next in Thread]