Hello,
i would like to insert R code in LaTeX document.
I see something about the 'listings' package, but i would like if it is the
best way and if it is possible to use the command \include{programme.R}.
I have the following solution but it doesn't work with \include and \input
======
LaTex
======
main.tex
------------------
\documentclass{report}
\usepackage{listings}
\lstloadlanguages{R}
\begin{document}
\include{annexe}
\end{document}
annexe.tex
---------------
The code is:
\lstset{language=R}
#\include{} or \input or direct code ???
R code
========
# test
rm(list=ls())
x<-1:10
mean(x)
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.