0

I am new to texmaker. I have difficulty in displaying the codes and results I got from R in my texmaker document.

For example I have this results:

> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

How do I display that in texmaker that it looks like the one you are seeing? (indented, gray background, looks like a code from R).

What do I need to have?

Thanks!

dixi
  • 680
  • 1
  • 13
  • 27
  • Do you want to actually execute the `R`code? If so, you'll need to look to a package like `knitr` which can run `R` code embedded in Tex documents. – keegan Nov 14 '14 at 19:37
  • not for now. I just need to display both the command and the results. – dixi Nov 14 '14 at 19:57

2 Answers2

0

Would the listings package (which supports R) achieve what you want?: http://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings

In LaTeX you can also just use the verb(atim) environment for fixed-width, not interpreted text:

/begin{verb}
    > R code goes here...
/end{verb}

?

Phil
  • 4,344
  • 2
  • 23
  • 33
0

If you want to display both the command and the results, then don't you need to execute the R code? (Unless you are planning to copy and paste the results...).

I would suggest checking out the knitr package.

marbles
  • 121
  • 7