Alexandre Depire <depire <at> gmail.com> writes: > > 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
Following latex code worked for me. Anupam \documentclass{report} \usepackage{listings} \begin{document} Somethings ..... \lstset{% general command to set parameter(s) basicstyle=\small, % print whole in small stringstyle=\ttfamily, % typewriter type for strings numbers=left, % numbers on the left numberstyle=\tiny, % Tiny numbers stepnumber=2, % number every second line of code numbersep=5pt, % 5pt seperation between numbering and code listing language=R } \lstinputlisting{text1.R} \end{document} ______________________________________________ R-help@stat.math.ethz.ch 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.