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

Duncan Murdoch murdoch at stats.uwo.ca
Wed Aug 12 01:40:02 CEST 2009


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.

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.  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.

Duncan Murdoch



More information about the R-devel mailing list