多个针织文档中的单个样式表 [英] single style sheet across multiple knitr documents

查看:67
本文介绍了多个针织文档中的单个样式表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是knitr的新手,我希望使用它来编写许多knitr文档,这些文档使用相同的共享样式表"以保持一致性.

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.

我希望在knitr/LaTeX中写我的博士论文附录.我正在创建多个不同的统计模型,希望以一致的方式进行描述,因此使用相同的标题,绘图格式和布局等.

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.

除了将我正在使用的程序包的所有标头信息和自定义的LaTeX命令放入单独的文件中,并使用\include{}将其放在每个文件的开头时,我还能做些什么来标准化我的型号说明?

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?

修改: 我希望在多个knitr .Rnw文件中的共同点尽可能少.在普通R中,我将使用函数进行参数化,而在LaTeX中,我将使用参数化的documentclass-我看不到如何在不剪切和粘贴大量代码且具有不可避免的一致性的情况下跨多个knitr文档获得这种清晰的参数化错误.

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.

我需要在此处创建一个示例-稍后再回来!

推荐答案

.Rmd文件开头是否使用类似以下的内容?

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.

这篇关于多个针织文档中的单个样式表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆