Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidy=T gives extra blank lines in Sweaved file #31

Open
aecay opened this issue May 29, 2011 · 2 comments
Open

tidy=T gives extra blank lines in Sweaved file #31

aecay opened this issue May 29, 2011 · 2 comments

Comments

@aecay
Copy link
Contributor

aecay commented May 29, 2011

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.

@yihui
Copy link
Contributor

yihui commented May 30, 2011

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 (#26), but the reason is not tidy=T.

@cameronbracken
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants