emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] No results when combining :session *R* with print.xtable


From: John Hendy
Subject: Re: [O] No results when combining :session *R* with print.xtable
Date: Wed, 16 Mar 2016 12:56:27 -0500

On Thu, Mar 10, 2016 at 1:11 PM, Stephan Lindner <address@hidden> wrote:
> Hi,
>
> I encounter the following problem (org version 8.3.2):

[snip]

> However, when I also include the =:session *R*= in my header, I get this:
>
> #+BEGIN_SRC R :session *R* :exports results :results replace output latex 
> :eval export
> library(xtable)
> print(xtable(matrix(c(1,2,3), nrow=1)),
>             only.contents=TRUE, include.rownames=FALSE, 
> include.colnames=FALSE, comment=FALSE, hline.after=NULL)
> #+END_SRC
>
> #+RESULTS:
> #+BEGIN_LaTeX
> #+END_LaTeX
>
> I.e., no result. However, when evaluating the code in R it works (i.e., R 
> prints out =1.00 & 2.00 & 3.00 \\=).

I can reproduce, and played around with a few things but none worked
very well. I tried using :results output wrap and manually printing
the #+begin_export latex lines myself, but couldn't get the full
output (just the printed #+begin line which seemed to ignore the
xtable() bit afterward).

What about using ascii instead? See attached for the equivalent if it
would work for you. It creates the table directly in Org-mode table
syntax vs. the raw latex. Not sure if that cramps your style with
respect to your full document and what you're doing with the combined
output.

I also attached a modified version using :results raw :wrap latex. I
*think* this should work, but the wrapping isn't correct. It should be
#+begin_export latex vs. #+begin_latex. I may start another thread for
this, as this is new to the current version of Org (or at least the
git version I'm on, 8.3.4). I thought the change was earlier, but if
your :output latex creates what you have above, it must not have been.
Mine automatically produces #+begin/end_export latex, but :wrap still
uses the older syntax.

Regarding the error itself, definitely seems like a bug, as you can
still see the xtable() output in the R buffer; it's just not getting
picked up by babel. Hopefully someone more knowledgeable sees this and
can comment. My contribution is just a workaround! In the end, with a
couple adjustments (footnoted), they all seem to produce the same.


Best regards,
John

Attachment: xtable-test.org
Description: Binary data

Attachment: xtable-test.pdf
Description: Adobe PDF document


reply via email to

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