From hb at biostat.ucsf.edu  Fri Aug 30 21:36:28 2013
From: hb at biostat.ucsf.edu (Henrik Bengtsson)
Date: Fri, 30 Aug 2013 12:36:28 -0700
Subject: [Rd] Problem with texi2pdf(..,clean=TRUE)
In-Reply-To: <5220F0B7.2000107@aon.at>
References: <5220EBBE.8080504@aon.at>
	<D9E36BC9-3F08-4735-A61C-C183486D59C3@me.com>
	<5220EF23.5040400@gmail.com> <5220F0B7.2000107@aon.at>
Message-ID: <CAFDcVCSRbFwDAee0sUtkQHwEK-488b=5uhq142n_eKgwCjV1RA@mail.gmail.com>

On Fri, Aug 30, 2013 at 12:21 PM, cstrato <cstrato at aon.at> wrote:
> Dear Duncan, dear Marc,
>
> Thank you for your fast reply.
>
> Can you please tell me:
> If texi2pdf() won't delete files how are the files deleted when the
> directory structure is Test/inst/doc/?

Check if what you're observing is reproducible when you run it *many*
times.  If not, see my previous reply.

/Henrik

> Is this done by Sweave()?
>
> Best regards,
> Christian
>
>
>
> On 8/30/13 9:14 PM, Duncan Murdoch wrote:
>>
>> On 30/08/2013 3:09 PM, Marc Schwartz wrote:
>>>
>>> On Aug 30, 2013, at 2:00 PM, cstrato <cstrato at aon.at> wrote:
>>>
>>> > Dear all,
>>> >
>>> > To create a *.pdf file from a *.Rnw file I do:
>>> >
>>> >      olddir <- getwd();
>>> >      setwd(outdir);
>>> >
>>> >      tryCatch({Sweave("QAReport.Rnw");
>>> >                tools::texi2pdf("QAReport.tex", clean=TRUE)
>>> >               },
>>> >               finally = setwd(olddir)
>>> >              );
>>> >
>>> > This works fine, however 'clean=TRUE' does only work when:
>>> >     outdir <- "Test/inst/doc/"
>>> > but does not remove the files *.aux, *.log, *.toc when:
>>> >     outdir <- "Test/"
>>> >
>>> > Why does function texi2pdf() require the directory structure for
>>> vignettes for the deletion of interim files?
>>> >
>>> > (The help file?texi2pdf does not mention that this structure is
>>> necessary.)
>>> >
>>> > Best regards
>>> > Christian
>>>
>>>
>>> In the Details section of ?texi2pdf, there is:
>>>
>>> "Despite the name, this is used in R to compile LaTeX files,
>>> specifically those generated from vignettes."
>>>
>>>
>>> Since it is intended specifically for package vignettes, the path
>>> requirement should not be a surprise. :-)
>>>
>>
>> There is no path requirement.  Christian was incorrect in his diagnosis.
>>
>> texi2pdf won't delete files that existed before it was run, whether or
>> not they were changed during the run.  That's likely what Christian was
>> seeing.
>>
>> Duncan Murdoch
>>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Problem with texi2pdf(..,clean=TRUE)
Henrik Bengtsson