I\'m working with knitr lately and while most aspects of that have gone quite smoothly, there\'s one formatting issue with including R code in the finished document that I haven
This answer is a bit late to the party, but I have found that even when I use tidy.opts = list(width.cutoff = 60)
in an early chunk (using RStudio and a .Rnw script) and then in each chunk option list I include tidy = TRUE
, the overflow of lines still happens. My overflow lines are in sections of code that create ggplot2 plots. Trial and error discovered that if I add a carriage return after the + at the end of a line, I have no overflow problems. The extra line does not show up in the PDF that LaTeX creates.