From rolandh at uni-muenster.de  Mon Nov  3 22:08:58 2014
From: rolandh at uni-muenster.de (rolandh at uni-muenster.de)
Date: Mon, 03 Nov 2014 22:08:58 +0100 (CET)
Subject: [Rd] Pkg creation: Sweave: multiple files vignette: Error in R CMD
	check
Message-ID: <permail-20141103210858fe5316b600004702-rolandh@message-id.uni-muenster.de>

Hello R-developers!

I am creating a package (using devtools and RStudio) and I would like to split
my vignette into multiple Rnw-files.

As an example I tried the code from:
https://support.rstudio.com/hc/en-us/articles/200486298
(--> Working with multiple Rnw files)

The Rnw-files work fine with "Complie pdf" in RStudio as well as with
Sweave("Master.Rnw").

But, if I try to check my package I get the following error:

...
* creating vignettes ... ERROR
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  :
  Ausf?hren von 'texi2dvi' f?r 'ChapterY.tex' fehlgeschlagen.
LaTeX errors:
! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...
! Emergency stop.
<*> ...13 \let~\normaltilde  \input ./ChapterY.tex

*** (job aborted, no legal \end found)

!  ==> Fatal error occurred, no output PDF file produced!
Calls: <Anonymous> -> texi2pdf -> texi2dvi
Ausf?hrung angehalten
Fehler: Command failed (1)
Ausf?hrung angehalten

Exited with status 1.
###


So, it seems like that it is tried to make a tex-file from my child-Rnw-file
called "ChapterY.Rnw",
what of couse is not possible, because that file contains no praeambel.

As a workaround I tried to put my child-Rnw-file in a subfolder (ChapterY) and
calling this file by
\SweaveInput{ChapterY/ChapterY.Rnw}.
Again, "Complie pdf" as well as Sweave("Master.Rnw") works fine, but with
checking the package
I get the following error:

Error in SweaveReadFile(c(ifile, file), syntax, encoding = encoding) :
  no Sweave file with name ?./ChapterY/ChapterY.Rnw? found
ERROR: installing vignettes failed


By the way I tried that on different (L)ubuntu machines (12.04, 14) which the
latest version of
RStudio and R, and I also tried it after updating texlive to version 2012,
always getting the same error.

Moreover, if I just use one Rnw-file instaed of multiple files checking the
package finished fine without errors!

I do not know what to do anymore, and I did not find any solution in the www
...

Do someone has any idea how to solve this problem in any way?

Thank you very very much in advance!

Greetings!

Roland

###
R version 3.1.2 (2014-10-31)
Platform: i686-pc-linux-gnu (32-bit)

locale:
 [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C               LC_TIME=de_DE.UTF-8
 LC_COLLATE=de_DE.UTF-8
 [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=de_DE.UTF-8
 LC_PAPER=de_DE.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
 LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] trajcoert01_0.1

loaded via a namespace (and not attached):
 [1] devtools_1.6       geosphere_1.3-8    grid_3.1.2         intervals_0.14.0
 lattice_0.20-29
 [6] move_1.2.475       raster_2.2-31      rgdal_0.8-16       rgeos_0.3-4
 sp_1.0-15
[11] spacetime_1.1-2    tools_3.1.2        trajectories_0.1-1 xts_0.9-7
zoo_1.7-11
###



[Rd] Pkg creation: Sweave: multiple files vignette: Error in R CMD check
rolandh at uni-muenster.de