Berwin A Turlach
2016-Jan-12 04:59 UTC
[Rd] Small inaccuracy in the Writing R Extensions manual
G'day all, In Chapter 1.4 (Writing package vignettes) the Writing R Extensions manual states: By default @code{R CMD build} will run @code{Sweave} on all Sweave vignette source files in @file{vignettes}. If @file{Makefile} is found in the vignette source directory, then @code{R CMD build} will try to run @command{make} after the @code{Sweave} runs, otherwise @code{texi2pdf} is run on each @file{.tex} file produced. This does not seem to be quite correct as stated. 'R CMD build' seems to run make only if there was a file in the directory vignettes that Sweave successfully processed. If the directory vignettes contains a Makefile and subdirectories in which the actual vignettes are, 'R CMD build' does not run make. Cheers, Berwin
Duncan Murdoch
2016-Jan-12 12:32 UTC
[Rd] Small inaccuracy in the Writing R Extensions manual
On 11/01/2016 11:59 PM, Berwin A Turlach wrote:> G'day all, > > In Chapter 1.4 (Writing package vignettes) the Writing R Extensions > manual states: > > By default @code{R CMD build} will run @code{Sweave} on all > Sweave vignette source files in @file{vignettes}. If > @file{Makefile} is found in the vignette source directory, then > @code{R CMD build} will try to run @command{make} after the > @code{Sweave} runs, otherwise @code{texi2pdf} is run on each > @file{.tex} file produced. > > This does not seem to be quite correct as stated. 'R CMD build' seems > to run make only if there was a file in the directory vignettes that > Sweave successfully processed. If the directory vignettes contains a > Makefile and subdirectories in which the actual vignettes are, 'R CMD > build' does not run make. >I think it is behaving as documented: it says it will run make after Sweave, so if Sweave never ran, neither would make. But perhaps your suggestion is good: it should run make whether or not Sweave (or some non-Sweave vignette builder) was run. Duncan Murdoch
Martin Maechler
2016-Jan-12 14:30 UTC
[Rd] Small inaccuracy in the Writing R Extensions manual
>>>>> Duncan Murdoch <murdoch.duncan at gmail.com> >>>>> on Tue, 12 Jan 2016 07:32:05 -0500 writes:> On 11/01/2016 11:59 PM, Berwin A Turlach wrote: >> G'day all, >> >> In Chapter 1.4 (Writing package vignettes) the Writing R >> Extensions manual states: >> >> By default @code{R CMD build} will run @code{Sweave} on >> all Sweave vignette source files in @file{vignettes}. If >> @file{Makefile} is found in the vignette source >> directory, then @code{R CMD build} will try to run >> @command{make} after the @code{Sweave} runs, otherwise >> @code{texi2pdf} is run on each @file{.tex} file produced. >> >> This does not seem to be quite correct as stated. 'R CMD >> build' seems to run make only if there was a file in the >> directory vignettes that Sweave successfully processed. >> If the directory vignettes contains a Makefile and >> subdirectories in which the actual vignettes are, 'R CMD >> build' does not run make. >> > I think it is behaving as documented: it says it will run > make after Sweave, so if Sweave never ran, neither would > make. But perhaps your suggestion is good: it should run > make whether or not Sweave (or some non-Sweave vignette > builder) was run. > Duncan Murdoch I agree. These were my thoughts too. Martin
Berwin A Turlach
2016-Jan-12 16:11 UTC
[Rd] Small inaccuracy in the Writing R Extensions manual
G'day Duncan, On Tue, 12 Jan 2016 07:32:05 -0500 Duncan Murdoch <murdoch.duncan at gmail.com> wrote:> On 11/01/2016 11:59 PM, Berwin A Turlach wrote: > > G'day all, > > > > In Chapter 1.4 (Writing package vignettes) the Writing R Extensions > > manual states: > > > > By default @code{R CMD build} will run @code{Sweave} on all > > Sweave vignette source files in @file{vignettes}. If > > @file{Makefile} is found in the vignette source directory, > > then @code{R CMD build} will try to run @command{make} after the > > @code{Sweave} runs, otherwise @code{texi2pdf} is run on each > > @file{.tex} file produced. > > > > This does not seem to be quite correct as stated. 'R CMD build' > > seems to run make only if there was a file in the directory > > vignettes that Sweave successfully processed. If the directory > > vignettes contains a Makefile and subdirectories in which the > > actual vignettes are, 'R CMD build' does not run make. > > > > I think it is behaving as documented: it says it will run make after > Sweave, so if Sweave never ran, neither would make.Sorry, I disagree. It says that "R CMD build will try to run make after the Sweave runs". For me (and probably others) "after the Sweave runs" (note the plural) include the cases of "no Sweave runs" and "one Sweave run". Otherwise the case of one vignette in the vignettes directory would produce undocumented (albeit expected) behaviour. :-) Cheers, Berwin