pgfSweave book project

39 views
Skip to first unread message

SyTpp

unread,
Mar 13, 2012, 8:33:09 AM3/13/12
to tikzd...@googlegroups.com
Dear list,

I'm about to start writing my PhD Thesis and I'd like to do it with
pgfSwaeve. Because it's gone be pretty big I'd like to use a book style
format and use multiple folders to structure chapters.
I have experience with multi-chapter/multi-folder projects in LaTex (with
the '\include' command) but I don't know how to active the same with
pgfSweave. So far I've only used pgfSweave for single .Rnw documents, like
reports or articles. Could you please hint we to a help page a describe
briefly how the structure of main .Rnw document and '\included' documents
should look like?

Kind Regards
Sylvia

Cameron Bracken

unread,
Mar 14, 2012, 11:50:55 AM3/14/12
to SyTpp, tikzd...@googlegroups.com
Hi Sylvia-

As it turns out there is a command \SweaveInput{} that can be used in place of the \input command in your document. This will bring in and process your chapters as if they were part of the main document. 

A word of caution. If I remember correctly you have to be careful with your relative paths. For example if you have your main document "main.Rnw" and you have a chapter "chapter1.Rnw" in a directory "chapter1/" then you would have to put \SweaveInput{chapter1/chapter1.Rnw} in your main document. THEN say you have a figure "a.pdf" in a figures folder for chapter 1 say "chapter1/figures/" to include a figure from that directory in "chapter1.Rnw", you would have to list the path relative to the main document, "chapter1/figures/a.pdf" NOT relative to the chapter. 

Cheers,
-Cameron


_______________________________________________
Tikzdevice-bugs mailing list
Tikzdev...@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tikzdevice-bugs

SyTpp

unread,
Mar 19, 2012, 7:45:08 AM3/19/12
to tikzd...@googlegroups.com, SyTpp

>
> Dear Cameron,
>
thank you very much for your help! I set up a little example now with
thesis.Rnw and a chapter1/chap1.Rnw.
The figures folder is directly in the main directory, so not in every
single chapter folder. I specify only in the main thesis.Rnw the location
of the
figures and in the chap1.Rnw I do not have any document specifications but
only directly latex and pgfSweave code chunks.
Im principle I do get a thesis.pdf in the end that contains all the
elements I expect, however I have some errors on the way:

>> R CMD pgfSweave thesis.Rnw
c("‘chap1.Rnw’", "‘thesis.Rnw’") has unknown encoding: assuming Latin-1

>> make -f thesis.makefile
pdflatex -halt-on-error -interaction=batchmode -jobname "figures/fig-plot1"
"\def\tikzexternalrealjob{thesis}\input{thesis}"
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)
restricted \write18 enabled.
entering extended mode
All images exist now. Use make -B to re-generate them.

>> pdflatex thesis.tex


I don't know if I should just ignore the errors since I seem to get what I
want in the end, however I'm afraid as my project will now
grow bigger and more complicated (more figures, references,
bibliography...) I will run into problems later on. So, I'd prefer to have a
clean compilation to begin with, so in case things get more complicated I
know where the errors come from.

Can you help me with this?

Thank you and kind regards!
Sylvia

Cameron Bracken

unread,
Mar 19, 2012, 12:42:33 PM3/19/12
to SyTpp, tikzd...@googlegroups.com
Hi Sylvia,

It doesn't look like you are getting any actual errors. The second
message is not an error, just a print out of what pgfSweave is doing.
The first message can be fixed by declaring the encoding of your
document, most likely it would be

\usepackage[utf8]{inputenc}

otherwise replace utf8 with the encoding you are using.

-Cameron

Reply all
Reply to author
Forward
0 new messages