From peter.ruckdeschel at web.de  Fri Aug 14 14:37:52 2009
From: peter.ruckdeschel at web.de (Peter Ruckdeschel)
Date: Fri, 14 Aug 2009 14:37:52 +0200
Subject: [Rd] Awkward escaping with five backslashes within \code{ } in
 new parse_Rd
In-Reply-To: <4A820152.9060201@stats.uwo.ca>
References: <h5spui$dmq$1@ger.gmane.org> <4A820152.9060201@stats.uwo.ca>
Message-ID: <h63lr0$md5$1@ger.gmane.org>

Dear R-devels,
dear Duncan,

just to close this thread...

> Peter Ruckdeschel wrote:
>> Hi R-devels,
>>
>> I noticed that you are working quite actively on the new Rd-parser
>> and have made it the default renderer in R-2.10.0dev. So I would
>> like to come back on an issue I have already raised on this list
>> last November
>>
>> ("Two minor escaping issues using \preformatted{....} in Rd format")
>>
>> My setting has slightly changed as \preformatted, AFAICS is not
>> supported within \describe environments, so I have switched to
>> \code{} ...
>>
>> The issue is again the correct typesetting of
>>
>>
>>             \\\\\%
>>
>> within a \code{}-tag.
>>
>> This sequence occurs within a string (hence valid R code) in the
>> documentation to my CRAN package SweaveListingUtils.
>>   
> 
> That's not valid R code within a string, because \% is not a valid escape.
> 

This was indeed the issue.

Omitting the fifth backslash respectively solved it.


> I think this is a case where you are not going to be able to find
> something that is compatible with both the old and new systems.  If you
> want to know how to get particular output in the new system, I'd be
> happy to help:  just tell me exactly what you want.
>> So far the new parser cannot swallow such sequences
>> of 5 backslashes followed by a percent sign correctly, but rather
>> still throws an error;
>>
>> as the former parser, it can digest it if I leave a space between the
>> fourth and fifth backslash, but then also prints this space out what is
>> not what I want.
>>
>> Now admittedly this is not an urgent question, but if you are
>> working on the parser anyway, you might perhaps try to make my
>> sequence digestible, too.
> 
> I need more information about what you want the output to look like, in
> text, for example.  

In an offline mail, I had sent links to the corresponding .Rd files
directly to Duncan, who then checked that the solution given
produced parsed code as desired.

> Because the Rd format is so ornate, I need more than
> just the particular string:  please send me the surrounding text, what
> your intentions are, and a large payment in unmarked bills.  Or at least
> the first two.

I think I now owe some bills to Duncan ;-)

[thanks to him once again!]

Best, Peter



[Rd] Awkward escaping with five backslashes within \code{ } in new parse_Rd
Peter Ruckdeschel