How to reduce vertical margin before/after knitr output in LaTeX

Annoyed with knitr output taking too much space in your LaTeX documents? Here’s a solution.

The following LaTeX command should reduce vertical space
before/after knitr
output.

\setlength{\topsep}{0pt}

Note that, however, in certain configurations this may have
some side effects on typesetting of other environments.

This may also help to “compress” the output:

\setlength{\parskip}{0pt}
\setlength{\partopsep}{1pt}


Marek Gągolewski

Tagged with: , ,
Posted in Blog/LaTeX, Blog/R-knitr