From murdoch at stats.uwo.ca  Fri Nov  7 02:32:18 2008
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Thu, 06 Nov 2008 20:32:18 -0500
Subject: [Rd] Two minor escaping issues using \preformatted{....} in Rd
 format
In-Reply-To: <491336E1.6010702@web.de>
References: <491336E1.6010702@web.de>
Message-ID: <49139AA2.1030803@stats.uwo.ca>

On 06/11/2008 1:26 PM, Peter Ruckdeschel wrote:
> Hi r-devels,
> 
> I have two minor problems with special characters in Rd files when
> used within a  \preformatted{} markup command:
> 
> ------------------------------------------------------
> 1. issue: backslash + single brace
> ------------------------------------------------------
> 
> I would like to write "\\\}" to produce \} on output (documenting
> the need to escape the brace once again before TeX-ing it);
> this fails if there is no space between the second and third
> backslash, but works if there is a space, but this produces
> \ } then....

We have started some work on overhauling Rd processing.  Your comments 
on the early work would be welcome.  These might appear in 2.9.0, or 
maybe later, or maybe not at all.  You can read about them on 
developer.r-project.org.

In this case, what you want to write would be supported.  Mark's 
workaround would no longer work, because \link{} wouldn't be recognized 
within \preformatted.


> ------------------------------------------------------
> 2. issue: backslash + percent sign
> ------------------------------------------------------
> 
> I would like to write "\\\\\%" to give a string argument \\% on
> output; this is needed for documenting how to register special
> operators to TeX package 'listings'.
> Again this fails, while "\\\\ \%" works.
> 
> In neither case 1 or 2 the standard TeX trick to produce a
> linebreak in the source without producing a space on output
> helps, i.e.
> 
> \\%
> \}
> 
> resp.
> \\\\%
> \%
> 
> both produce valid code [the resp. first % is read as a comment
> sign] but also insert a non-intended space in the output.

Those would probably still insert spaces under the proposed changes.

Duncan Murdoch

> Any idea how to circumvent this?
> Best, Peter
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Two minor escaping issues using \preformatted{....} in Rd format
Duncan Murdoch