I wanted to decrease the space between chunks in my Rnw file (LateX+R+Knitr). I came across the following Rnw file that works for text output: https://gist.github.com/yihui/2760395#file-knitrout-parskip-rnw. If you have a chart it doesn't - the chart is moved too far upwards and a code as well as the chart overlap. Is there any possibilities to redefine knitrout in order to influence on output text not charts? I don't know how to attach pdf output but below is the code.
\documentclass{article}
% change the space between paragraphs in chunks
\ifdefined\knitrout
\renewenvironment{knitrout}{
\setlength{\parskip}{-1in}
}{
\setlength{\parskip}{0in}
}
\else
\fi
\begin{document}
The quick brown fox jumps over the lazy dog the quick brown fox jumps over the
lazy dog the quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog the quick brown fox jumps over the
lazy dog the quick brown fox jumps over the lazy dog.
<<test>>=
set.seed(77)
1+1
(x <- rnorm(30))
@
The quick brown fox jumps over the lazy dog the quick brown fox jumps over the
lazy dog the quick brown fox jumps over the lazy dog.
<<fig.height=3>>=
plot(x)
@
The quick brown fox jumps over the lazy dog the quick brown fox jumps over the
lazy dog the quick brown fox jumps over the lazy dog.
\end{document}