I am using the environnement "lstlistings" to insert chunks of R in a LaTeX paper. I would like to have the text of R commands in blue color and the output of R in red color. How can I do that ? I saw an answer when using delimiters, but I doesn't want to use delimiters

These three lines in blue: tt<-c(1:length(y)) reg_mod0<-lm(y~tt) summary(reg_mod0)

These four lines in red: Coefficients: Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.59595 1.77291 22.334 <2e-16 *** tt 0.33542 0.09377 3.577 0.0012 **

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.