Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (16 sloc) 540 Bytes
\documentclass[preview]{standalone}
\lstset{breaklines=true} % break long lines
<<setup, include=FALSE>>=
library(knitr)
render_listings()
@
\begin{document}
We can set the \texttt{breaklines} option to \texttt{true} to wrap long lines.
<<long-print>>=
print("asdlfjk sadflkj kljsd klwjr klwjre klwjer kljwre kljwer lkjrwee lkwjre lkwjere lkwjer lkwjre lkasdfa afsd afdafsd afddadf adfsadf afdasdf")
@
By comparison, this shows \texttt{breaklines=false}:
\lstset{breaklines=false} % break long lines
<<long-print>>=
@
\end{document}