r - Getting Sweave code chunks to stay inside page margins? -
r - Getting Sweave code chunks to stay inside page margins? -
sometimes create r code chunk (in sweave) longer margins of page. there way forcefulness "go next line" 1 time happens?
here simple illustration of happening:
\documentclass[a4paper]{article} \usepackage{sweave} \defineverbatimenvironment{sinput}{verbatim} {xleftmargin=2em, frame=single} \defineverbatimenvironment{soutput}{verbatim}{xleftmargin=2em, frame=single} \title{sweave boxes} \begin{document} \maketitle <<echo=false>>= options(width=60) @ here illustration of code chunk followed output chunk, both enclosed in boxes. <<>>= print(rnorm(99)) @ <<>>= print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") @ \end{document}
this hard , extreme case, because not have spaces among a
's, latex may not able wrap words. if have spaces, knitr
able produce output long lines wrapped tidy=true, highlight=true
(so sweave, think, if set keep.source=false
).
r latex tex sweave
Comments
Post a Comment