Hello Jack, Thanks for taking the time to reply.
> I think a more reliable implementation would be to avoid > `org-babel-comint-with-output', and take the approach used in the > ":results value" case, which reads the output from a temp file instead > of directly from the shell. I understand better now. Thanks > > Actually, that's the approach I use in my ob-session-async package [0], > which re-implements ob-R sessions to allow async evaluation. It doesn't > suffer from the bug you are reporting. I'll plan to extract that > implementation and submit it as a patch here. Your solution works just fine. I came across ob-session-async a recently and find it very interesting thanks again. #+begin_src R :results output html :cache no :async session library(xtable) x <- rnorm(100) y <- x + rnorm(100) a <- summary(lm(y ~ x)) print(xtable(a),type="html",comment=FALSE) #+end_src #+RESULTS: #+begin_export html <table border=1> <tr> <th> </th> <th> Estimate </th> <th> Std. Error </th> <th> t value </th> <th> Pr(>|t|) </th> </tr> <tr> <td align="right"> (Intercept) </td> <td align="right"> 0.1249 </td> <td align="right"> 0.0961 </td> <td align="right"> 1.30 </td> <td align="right"> 0.1969 </td> </tr> <tr> <td align="right"> x </td> <td align="right"> 0.9263 </td> <td align="right"> 0.0879 </td> <td align="right"> 10.53 </td> <td align="right"> 0.0000 </td> </tr> </table> #+end_export Best regards, Jeremie