[Rd] Sweave trims console output in "tex" mode

Kirill Müller kirill.mueller at ivt.baug.ethz.ch
Fri Jan 3 01:05:03 CET 2014


In the example .Rnw file below, only the newline between c and d is 
visible in the resulting .tex file after running R CMD Sweave. What is 
the reason for this behavior? Newlines are important in LaTeX and should 
be preserved. In particular, this behavior leads to incorrect LaTeX code 
generated when using tikz(console=TRUE) inside a Sweave chunk, as shown 
in the tikzDevice vignette.

A similar question has been left unanswered before: 
https://stat.ethz.ch/pipermail/r-help/2010-June/242019.html . I am well 
aware of knitr, I'm looking for a solution for Sweave.



cat("b\n \n")

More information about the R-devel mailing list