Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
customize the knitrout environment
\documentclass{article}
% change the space between paragraphs in chunks
\parindent = 0.0in
\parskip = 0.125in
\ifdefined\knitrout
\renewenvironment{knitrout}{
\setlength{\parskip}{0in}
}{
\setlength{\parskip}{0.125in}
}
\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>>=
1+1
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.
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}
\documentclass{article}
% decrease the space before and after the chunk output environment
% (use negative vertical space)
\ifdefined\knitrout
\renewenvironment{knitrout}{
\vspace{-1em}
}{
\vspace{-1em}
}
\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>>=
1+1
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.
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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment