Hello,
I'm learning to use Sweave, and I've run into a problem: sometimes, when
entering long lines of input and using long variable names, Sweave will not
insert linebreaks in a way that respects the width setting. This causes
undesirable overflows into the margins in the latex file. For example,
consider the following document (adapted from the GLM example):
\documentclass{article}
<<setup,include=FALSE,echo=FALSE>>=
<<test>>=
\end{document}
When I compile this, treatmentasdfasdfasdfasdf sticks out into the right
margin. The linebreak is inserted after the last comma, so that the line as
printed is 85 characters long, even though I set width to 80 at the top.
Ideally, Sweave would set the linebreak after the last plus symbol.
There is a simple workaround that I have been using: if a line causes
problems, set width to something smaller before the line, and set it back
afterwards. It's pretty clumsy though, and I wonder if there is a better
way. My understanding is that there is no way to manually set linebreaks,
what a pity!
I am using R 2.6.2 and the MacTex 2007 distribution. If this problem has
been fixed in a recent version, I apologize.
Cheers,
[[alternative HTML version deleted]]
\begin{document}
options(width=80)
@
countsasdfasdfasdf <- c(18,17,15,20,10,20,25,13,12)
outcomeasdfasdfasdf <- gl(3,1,9)
treatmentasdfasdfasdfasdf <- gl(3,3)
glm.D93 <- glm(countsasdfasdfasdf ~ outcomeasdfasdfasdf +
treatmentasdfasdfasdfasdf, family=poisson())
@
Enrico
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.
Archive generated by hypermail 2.2.0, at Mon 26 May 2008 - 20:31:29 GMT.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.