From xie at yihui.name  Wed Oct  9 23:04:16 2013
From: xie at yihui.name (Yihui Xie)
Date: Wed, 9 Oct 2013 16:04:16 -0500
Subject: [Rd] user defined macros in Rd files
In-Reply-To: <5255C2AA.6010807@gmail.com>
References: <CAC2h7usETeFHChYavo-mCP=4rSRX+Jzxta=e=S=S2sR0_6AAUw@mail.gmail.com>
	<CANROs4er+wdYVQ3MBS7tBn7uWTnot3VQPe3Tm-RTGhHo7AMm1A@mail.gmail.com>
	<5255C2AA.6010807@gmail.com>
Message-ID: <CANROs4d9xM5Qj7OW4T8KZe9s8y6d5h6AgMO9fnCueFW_-my38w@mail.gmail.com>

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.

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
>



[Rd] user defined macros in Rd files
Yihui Xie