[Tex/LaTex] How to modify knitr output chunk

knitrr

I know that it's possible to tweak the output of a knitr code chunk so that it
looks the way you want. My problem occurs when using the parskip package.
The parskip package adds an extra bit of space below the code output, which doesn't
look great. Here's a minimal .Rnw file.

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage{parskip}

\begin{document}
\setlength{\parindent}{0in}
Some text above chunk
<<echo=TRUE>>=
2 + 2
@
Some text below. The space above this is too big when using the \texttt{parskip} package.
Some text below. The space above this is too big when using the \texttt{parskip} package.
Some text below. The space above this is too big when using the \texttt{parskip} package.

A nice space between paragraphs.
\end{document}

Best Answer

This not an elegant answer but you can 'fix' the excess space with the inclusion of negative vertical space. See the modified code.

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
%\usepackage{parskip}

\begin{document}
\setlength{\parindent}{0in}
Some text above chunk
<<echo=TRUE>>=
2 + 2
@
\vspace{-1em}  %%% this moves the following text up the height of an 'm'
Some text below. The space above this is too big when using the \texttt{parskip} package.
Some text below. The space above this is too big when using the \texttt{parskip} package.
Some text below. The space above this is too big when using the \texttt{parskip} package.

A nice space between paragraphs.
\end{document}