From murdoch.duncan at gmail.com  Fri Jan  3 13:06:42 2014
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Fri, 03 Jan 2014 07:06:42 -0500
Subject: [Rd] Sweave trims console output in "tex" mode
In-Reply-To: <52C69527.8010502@ivt.baug.ethz.ch>
References: <52C5FEAF.5020708@ivt.baug.ethz.ch> <52C60835.8060605@gmail.com>
	<52C60A17.1040208@ivt.baug.ethz.ch>
	<52C60B71.3090803@gmail.com> <52C60C86.30702@ivt.baug.ethz.ch>
	<52C61395.30007@gmail.com> <52C6778F.8020204@ivt.baug.ethz.ch>
	<52C69375.6040402@gmail.com> <52C69527.8010502@ivt.baug.ethz.ch>
Message-ID: <52C6A7D2.2090103@gmail.com>

On 14-01-03 5:47 AM, Kirill M?ller wrote:
> I'm sorry, I didn't mean to be rude. Do you prefer including the entire
> original message when replying? Or perhaps I misunderstood you when you
> wrote:

You don't need to include irrelevant material in your reply, but you 
should include explanatory material when you are arguing about a 
particular claim.  If you aren't sure whether it is relevant or not, 
then you should probably ask for clarification rather than arguing with 
the claim.

>
>   > Carriage returns usually don't matter in LaTeX, so I didn't even know
> about this option, though I use results=tex quite often. I had to look
> at the source to see where the newlines were going, and saw it there.
>
> Could you please clarify? Thanks.

Single carriage returns are usually equivalent to spaces.  Multiple 
carriage returns separate paragraphs, but they are rare in code chunk 
output in my Sweave usage.  I normally put plain text in the LaTeX part 
of the Sweave document.

I have checked my own .Rnw files, and I have used results=tex about 600 
times, but never used strip.white.

I've also looked at the .Rnw files in CRAN packages, and 
strip.white=true and strip.white=all are used there about 140 times, but 
strip.white=false is only used 10 times.  I think only one package 
(SweaveListingUtils) uses strip.white=false in combination with results=tex.

So while I agree Martin's "adaptive" option would have been a better 
default than "true", I think it would be more likely to cause trouble 
than to solve it.

Duncan Murdoch

>
>
> -Kirill
>
>
> On 01/03/2014 11:39 AM, Duncan Murdoch wrote:
>> It's dishonest to quote me out of context.
>>
>> Duncan Murdoch
>>
>> On 14-01-03 3:40 AM, Kirill M?ller wrote:
>>> On 01/03/2014 02:34 AM, Duncan Murdoch wrote:
>>>> Carriage returns usually don't matter in LaTeX
>>> I'd rather say they do. One is like a space, two or more end a paragraph
>>> and start a new one. If newlines are stripped away, the meaning of the
>>> TeX code can change, in some cases dramatically (e.g. if comments are
>>> written to the TeX code).
>>>
>>> Also, I don't understand why the option is called strip.white, at least
>>> for results=tex. The docs say that "blank lines at the beginning and end
>>> of output are removed", but the observed behavior is to remove the
>>> terminating carriage return of the output.
>>>
>>>
>>> -Kirill
>>>
>>
>



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