Skip to content

Problem with texi2pdf(..,clean=TRUE)

14 messages · cstrato, Marc Schwartz, Duncan Murdoch +1 more

#
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
_._._._._._._._._._._._._._._._._._
C.h.r.i.s.t.i.a.n   S.t.r.a.t.o.w.a
V.i.e.n.n.a           A.u.s.t.r.i.a
e.m.a.i.l:        cstrato at aon.at
_._._._._._._._._._._._._._._._._._
#
On Aug 30, 2013, at 2:00 PM, cstrato <cstrato at aon.at> wrote:

            
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. :-)

Regards,

Marc Schwartz
#
On 30/08/2013 3:09 PM, Marc Schwartz wrote:
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
#
On Fri, Aug 30, 2013 at 12:14 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
Or, that the cleanup fails if the compilation is too quick, cf.
PR#15394 'texi2dvi(..., clean=TRUE) sometimes too quick for "clean"
(with PATCH)' submitted on July 17, 2013:

  https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15394

/Henrik
#
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/?
Is this done by Sweave()?

Best regards,
Christian
On 8/30/13 9:14 PM, Duncan Murdoch wrote:
#
On 30/08/2013 3:21 PM, cstrato wrote:
No.

Duncan Murdoch
#
On Fri, Aug 30, 2013 at 12:21 PM, cstrato <cstrato at aon.at> wrote:
Check if what you're observing is reproducible when you run it *many*
times.  If not, see my previous reply.

/Henrik
#
On Aug 30, 2013, at 2:20 PM, Henrik Bengtsson <hb at biostat.ucsf.edu> wrote:

            
Interesting.

It is late on a Friday, so perhaps I am short on functioning neurons.

If the intent of 'clean = TRUE' is to remove the byproducts of compiling the .PDF file from the source .TEX file, why not just delete the resultant aux|log|tex|dvi files that match the basename of the source .TEX file rather than being dependent upon the time stamp? 

Is there a reason that I am failing to consider for a need to retain these files if older than the current time stamp? Perhaps if the compilation requires multiple cycles of latex processing (eg. the use of longtables, etc.), in which case, one could run texi2pdf(..., clean = FALSE) some number of times, then a final texi2pdf(..., clean = TRUE) when done. I actually have my own shell script that does this when creating Sweave files.

Of course, the help file does have the following for the 'clean' argument: ...May not work on some platforms.

Thanks,

Marc
#
On Fri, Aug 30, 2013 at 12:40 PM, Marc Schwartz <marc_schwartz at me.com> wrote:
I'm quite sure because it is not easy/impossible to predict which the
byproducts are.  To catch everything, you'd have to do something
<basename>.* and that is certainly not safe.

/Henrik
#
Dear Henrik,

Thank you for your explanation.

Yes, this behavior is reproducible many times.

When I copy both lines together into R, i.e.
    Sweave("QAReport.Rnw")
    tools::texi2pdf("QAReport.tex", clean = TRUE)

then the auxiliary files are deleted. However, when I keep the *.tex 
file only and run:
    tools::texi2pdf("QAReport.tex", clean = TRUE)

then these files are not deleted. I can delete them manually many times 
and run texi2pdf() again, they will never be deleted.

I really hope that your patch will be applied, so that it works as 
expected with the next Bioconductor release on October.

Best regards,
Christian
On 8/30/13 9:36 PM, Henrik Bengtsson wrote:
#
Dear Henrik,

Below is the 'QAReport.Rnw' file which I use on my Mac to reproduce your 
problem. Maybe this will help others to reproduce this problem, too.

Best regards,
Christian

---- begin QAReport.Rnw ----
\documentclass{article}


\textwidth=6.2in
\textheight=8.5in
%\parskip=.3cm
\oddsidemargin=.1in
\evensidemargin=.1in
\headheight=-.3in

\newcommand{\Rfunction}[1]{{\texttt{#1}}}
\newcommand{\Rmethod}[1]{{\texttt{#1}}}
\newcommand{\Rcode}[1]{{\texttt{#1}}}
\newcommand{\Robject}[1]{{\texttt{#1}}}
\newcommand{\Rpackage}[1]{{\textsf{#1}}}
\newcommand{\Rclass}[1]{{\textit{#1}}}
\newcommand{\Cclass}[1]{{\textit{#1}}}
\newcommand{\Rexten}[1]{{\textit{#1}}}
\newcommand{\xps}{\Rpackage{xps}}
\newcommand{\ROOT}{\Robject{ROOT}}

\begin{document}

\title{Quality Report}
\date{October, 2011}
\author{Christian Stratowa}
\maketitle

\tableofcontents


\section{Introduction}

  This is the quality assessment report for the dataset 'My Dataset'. 
The dataset consists of
  6 Affymetrix GeneChip arrays of type 'Test3'. \\

  This report was generated using function \Rfunction{xpsQAReport} of 
package \xps. \\

\section{Summary}

  The current quality report for dataset 'My Dataset' displays the most 
important quality plots, using the
  default settings for most plots. Package \xps\ contains additional 
plots which can be used for further
  quality assessments. \\


\section*{Session Information:}

<<echo=FALSE>>=
sessionInfo()
@

\end{document}

---- end QAReport.Rnw ----
On 8/30/13 9:46 PM, Henrik Bengtsson wrote:
#
Dear Henrik,

I am trying to attach the 'QAReport.Rnw' file which I am using on my Mac 
to reproduce your problem.

Best regards,
Christian
On 8/30/13 9:50 PM, cstrato wrote:
-------------- next part --------------
\documentclass{article}


\textwidth=6.2in
\textheight=8.5in
%\parskip=.3cm
\oddsidemargin=.1in
\evensidemargin=.1in
\headheight=-.3in

\newcommand{\Rfunction}[1]{{\texttt{#1}}}
\newcommand{\Rmethod}[1]{{\texttt{#1}}}
\newcommand{\Rcode}[1]{{\texttt{#1}}}
\newcommand{\Robject}[1]{{\texttt{#1}}}
\newcommand{\Rpackage}[1]{{\textsf{#1}}}
\newcommand{\Rclass}[1]{{\textit{#1}}}
\newcommand{\Cclass}[1]{{\textit{#1}}}
\newcommand{\Rexten}[1]{{\textit{#1}}}
\newcommand{\xps}{\Rpackage{xps}}
\newcommand{\ROOT}{\Robject{ROOT}}

\begin{document}

\title{Quality Report}
\date{October, 2011}
\author{Christian Stratowa}
\maketitle

\tableofcontents


\section{Introduction}

 This is the quality assessment report for the dataset 'My Dataset'. The dataset consists of
 6 Affymetrix GeneChip arrays of type 'Test3'. \\

 This report was generated using function \Rfunction{xpsQAReport} of package \xps. \\

\section{Summary}

 The current quality report for dataset 'My Dataset' displays the most important quality plots, using the
 default settings for most plots. Package \xps\ contains additional plots which can be used for further
 quality assessments. \\


\section*{Session Information:}

<<echo=FALSE>>=
sessionInfo()
@ 

\end{document}
#
Just checked the SVN logs and the comparison towards file timestamps
have been dropped in R devel and R 3.0.1 SVN r63690 (Aug 25, 2013) and
newer.  It is now simply comparing the set of files before and after.
Try with one of those and I'll bet you that clean=TRUE does what it
supposed to.

/Henrik
On Fri, Aug 30, 2013 at 1:05 PM, cstrato <cstrato at aon.at> wrote:
#
Dear Henrik,

Thank you for this information, I will try to install the patched version.

Best regards,
Christian
On 8/30/13 10:23 PM, Henrik Bengtsson wrote: