[R] The itemize command in *.Rd files.

Duncan Murdoch murdoch at stats.uwo.ca
Wed Oct 17 03:52:23 CEST 2007


On 16/10/2007 8:18 PM, Rolf Turner wrote:
> On 17/10/2007, at 1:00 PM, Duncan Murdoch wrote:
> 
>> On 16/10/2007 7:46 PM, Rolf Turner wrote:
>>> I'm getting an anomalous result from using the itemize command in  
>>> a  documentation
>>> file.  My usage is something like
>>> \itemize{
>>> \item Melvin
>>> \item Irving
>>> \item Clyde
>>> \item Fred
>>> }
>>> (This was place inside ``\details{   }''.)
>> I just pasted that into an existing .Rd file, I think on the same  
>> platform as you report below, and it worked fine.  Could you put  
>> the full .Rd file online somewhere? It may be some other problem  
>> that is just showing up here.
>>
>> Duncan Murdoch
> 
> Here is a toy version which demonstrates the problem:
> 
> \name{bar}
> \alias{bar}
> \title{ Nothing much. }
> \description{
>    Nothing much.
> }
> \usage{
> bar(x)
> }
> \arguments{
>    \item{x}{ It is whatever you think it is. }
> }
> \details{
> The problem is illustrated by \itemize{
> \item Melvin
> \item Irving
> \item Clyde
> \item Fred
> }
> }
> \value{
> Nothing much
> }
> \author{ Rolf Turner \email{r.turner at auckland.ac.nz} }
> 
> \examples{
> \dontrun{
>          y <- bar(x)
> }
> }
> \keyword{ utilities }
> 
> When I execute ?bar (after loading the library) I get the output:
> 
> bar                 package:starpath                 R Documentation
> 
> Nothing much.
> 
> Description:
> 
>       Nothing much.
> 
> Usage:
> 
>       bar(x)
> 
> Arguments:
> 
>         x: It is whatever you think it is.
> 
> Details:
> 
>       The problem is illustrated by  .in +3

Okay, I see it now.  The bug shows up when the \itemize command
is not at the start of a line; you can avoid it by inserting a line feed 
there.  The cause is apparently that the translator from .Rd format to 
troff (or whatever that is) doesn't insert a newline.

I think the conversion from .Rd to this format is done by the Rdconv.pm 
Perl code; I'll see if I can track down the bug.

Duncan Murdoch

> 
>       *  Melvin
> 
>       *  Irving
> 
>       *  Clyde
> 
>       *  Fred
> 
> Value:
> 
>       Nothing much
> 
> Author(s):
> 
>       Rolf Turner r.turner at auckland.ac.nz
> 
> Examples:
> 
>       ## Not run:
>               y <- bar(x)
>       ## End(Not run)
> 
> Note the ``.in +3''.
> 
> Thanks for taking an interest.
> 
> 			cheers,
> 
> 				Rolf
> 
> ######################################################################
> Attention: 
> This e-mail message is privileged and confidential. If you are not the 
> intended recipient please delete the message and notify the sender. 
> Any views or opinions presented are solely those of the author.
> 
> This e-mail has been scanned and cleared by MailMarshal 
> www.marshalsoftware.com
> ######################################################################



More information about the R-help mailing list