[Rd] user defined macros in Rd files

Henrik Bengtsson hb at biostat.ucsf.edu
Thu Oct 10 01:54:49 CEST 2013

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.


> 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

More information about the R-devel mailing list