0

I am new to knitr, and I am looking to use it to write many knitr documents which use the same shared "style sheet" for consistency.

I am hoping to write my phd thesis appendices in knitr/LaTeX. I am in the process of creating a number of different statistical models which I want to describe in a consistent manner, so using the same headings, plot formats and layout etc.

Aside from putting all my header information for the packages I am using and my custom LaTeX commands into a separate file and using \include{} to pull them in at the start of each file, what more can I do to standardize my model descriptions?

Edit: I want to have as little as possible in common across the multiple knitr .Rnw files. In plain R, I would use a function to parameterize, in LaTeX, I use a parameterized documentclass - I can't see how to get this clean parametrization across multiple knitr documents without cutting and pasting lots of code and having the inevitable consistency mistakes.

I need to create an example here - back later!

Sean
  • 3,765
  • 3
  • 26
  • 48
  • For those who don't like my question, please explain what is less than perfect. Thanks – Sean Dec 06 '13 at 11:38
  • I think there are two sets of questions here, one set for LaTeX (better addressed on tex.stackexchange.com) and one for `knitr`. I do think the question needs to be more specific ... – Ben Bolker Dec 22 '13 at 16:45
  • Thanks @BenBolker, I saw it as a general knitr programming style question, and less about the LaTeX, which is why I asked here rather than tex.SE. – Sean Dec 23 '13 at 05:49
  • For reference, Yihui's book on Knitr has a useful section "9.3 Child Documents" which seems to answer this neatly. – Sean Jun 09 '14 at 15:34

1 Answers1

1

Do you use anything like the following at the start of your .Rmd file?

opts_chunk$set(echo=FALSE, message=FALSE, warning=FALSE, results="asis", fig.width= 4., fig.height= 4, fig.cap= "") 

At least some of the aspects of plots and captions below them -- here eliminated -- will be the same. I suspect there is much more to be done.

Thomas
  • 43,637
  • 12
  • 109
  • 140
lawyeR
  • 7,488
  • 5
  • 33
  • 63