single style sheet across multiple knitr documents [closed]

孤人 提交于 2019-12-25 09:35:13

问题


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!


回答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.



来源:https://stackoverflow.com/questions/20370584/single-style-sheet-across-multiple-knitr-documents

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!