From hb at biostat.ucsf.edu  Thu Oct 10 01:54:49 2013
From: hb at biostat.ucsf.edu (Henrik Bengtsson)
Date: Wed, 9 Oct 2013 16:54:49 -0700
Subject: [Rd] user defined macros in Rd files
In-Reply-To: <CANROs4d9xM5Qj7OW4T8KZe9s8y6d5h6AgMO9fnCueFW_-my38w@mail.gmail.com>
References: <CAC2h7usETeFHChYavo-mCP=4rSRX+Jzxta=e=S=S2sR0_6AAUw@mail.gmail.com>
	<CANROs4er+wdYVQ3MBS7tBn7uWTnot3VQPe3Tm-RTGhHo7AMm1A@mail.gmail.com>
	<5255C2AA.6010807@gmail.com>
	<CANROs4d9xM5Qj7OW4T8KZe9s8y6d5h6AgMO9fnCueFW_-my38w@mail.gmail.com>
Message-ID: <CAFDcVCS0mfjQt6OQiot6mqij-RM6dxnMutyZUJ1mgityeEGnfQ@mail.gmail.com>

On Wed, Oct 9, 2013 at 2:04 PM, Yihui Xie <xie at yihui.name> wrote:
> I mean, it sounds like a better idea to define \CRANpkg only once in
> one central place, and use it in base R, instead of defining it in
> every single Rd file, because it seems to be generally useful (is 91 a
> large number? maybe).
>
> Similarly, when it comes to an add-on package, it will be nice if the
> package author can define these macros in one place, and use them in
> his/her package.
>
> When we have to copy and paste a macro 91 times, it seems to have
> defeated the purpose of a macro.

On my related wishlist: A standardized mechanism to 'R CMD build' for
building man/*.Rd from any input format (e.g. roxygen and so on)
analogously how we can now build vignettes of any input format.  With
that in place, it would a be piece of cake to include macros from
external files.

Just wanted to throw it out there.

/Henrik

>
> Regards,
> Yihui
> --
> Yihui Xie <xieyihui at gmail.com>
> Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA
>
>
> On Wed, Oct 9, 2013 at 3:55 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>> On 13-10-09 4:34 PM, Yihui Xie wrote:
>>>
>>> +1. As an example, there are 91 instances of \newcommand{\CRANpkg} in
>>> R source, and this number is still growing as I see:
>>>
>>> $ grep "\\\\newcommand{\\\\CRANpkg}" -r . | wc
>>>       91      91   10317
>>>
>>
>> So you're saying if I ever get around to doing this, I'll have to track down
>> 91+ files to make use of it?  This sounds like an argument why someone else
>> should do it. ;-)
>>
>> Duncan Murdoch
>>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] user defined macros in Rd files
Henrik Bengtsson