Skip to content
Back to formatted view

Raw Message

Message-ID: <47D08CC7.4040101@stats.uwo.ca>
Date: 2008-03-07T00:31:03Z
From: Duncan Murdoch
Subject: Sweave and extra line
In-Reply-To: <47D07741.5010702@u-paris10.fr>

On 06/03/2008 5:59 PM, Christophe Genolini wrote:
> Hi the list,
> 
> I am using Sweave. Between the Sinput and the Soutput, there is always 
> an extra line:
> 
>  > 2+2
> 
> [1] 4
> 
> Is it possible to remove it ?

Here's some code I worked out a while ago:

% This removes the extra spacing after code and output chunks in Sweave,
% but keeps the spacing around the whole block.

\fvset{listparameters={\setlength{\topsep}{0pt}}}
\renewenvironment{Schunk}{\vspace{\topsep}}{\vspace{\topsep}}

Put this somewhere in your code before the first Sweave chunk.

Duncan Murdoch

> 
>  > 2+2
> [1] 4
> 
> Thanks
> 
> Christophe
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.