r - Knitr to PDF Does Not Honor Line Breaks? -
r - Knitr to PDF Does Not Honor Line Breaks? -
i have rnw file has simple code chunk:
<<echo = true, tidy = true>>= getnormintegral = function(x, sd = 1) { res = pnorm(x*sd, sd = sd) - pnorm(-1*x*sd, sd = sd) return(1.0 - res) } @
this looks here, when render pdf file using knitr, code collapses single line , runs past box. have tried set width alternative following:
<<echo=false>>= options(width=10) @
but did not have affect. resulting output in pdf is:
(ok, not extending past box boundaries, not honoring manual line breaks set in code...)
any suggestions create output code chunk typed in?
(i should add together using r 3.1.2, rstudio 0.99.34, , knitr 1.7)
just set tidy=false
in chunk options. knitr automatically tidies code.
r latex knitr
Comments
Post a Comment