
Eu sei que é possível ajustar a saída de um knitr
pedaço de código para que fique do jeito que você deseja. Meu problema ocorre ao usar o parskip
pacote. O parskip
pacote adiciona um espaço extra abaixo da saída do código, o que não parece ótimo. Aqui está um .Rnw
arquivo mínimo.
\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}
Responder1
Esta não é uma resposta elegante, mas você pode 'consertar' o excesso de espaço com a inclusão de espaço vertical negativo. Veja o código modificado.
\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}