pgfSweave icon indicating copy to clipboard operation
pgfSweave copied to clipboard

tidy=T gives extra blank lines in Sweaved file

Open aecay opened this issue 13 years ago • 2 comments

With the option tidy=T, each Sinput environment gets a spurious blank line. This can be seen with the following example file:

\documentclass{article}
\begin{document}
\SweaveOpts{highlight=FALSE}
\begin{Scode}{print=TRUE,cache=TRUE,tidy=TRUE}
1+1
\end{Scode}
\end{document}

which gives this output after R CMD pgfsweave test.Rtex (excerpted from the long .tex file generated):

\begin{Schunk}
\begin{Sinput}
> 1 + 1

\end{Sinput}
\end{Schunk}

The blank line should not be present, and leads to extra blank space in the pdf document. I think this is due to line 484 in R/pgfSweaveDriver.R, where a blank line is emitted if options$highlight or $tidy is true.

aecay avatar May 29 '11 02:05 aecay

Can you check out the GIT version of the package here and try it? (https://github.com/cameronbracken/pgfSweave/tarball/master) I think this blank space problem has been fixed (https://github.com/cameronbracken/pgfSweave/pull/26), but the reason is not tidy=T.

yihui avatar May 30 '11 17:05 yihui

I think this is actually a legit bug. This case (tidy=TRUE, highlight=FALSE) is rare and so wasn't caught in the spacing fixes, but the extra newline is not necessary from my tests.

cameronbracken avatar May 31 '11 18:05 cameronbracken