除了默认的主题外,还可以通过加载rticles、prettydoc、rmdformats、tufte等包获取更多主题格式。下面我们看看几类扩展包里的主题样式。 1 rticles包 官网:https://github.com/rstudio/rticles; 具体教程:https://bookdown.org/yihui/rmarkdown/rticles-templates.html rticles软件包提供了各种期刊和出版商的模板: JSS articles (Journal of Statistical Software) R Journal articles CTeX documents
似乎是谢益辉(https://yihui.org/)的rticles包出现了bug,所以更确切的说,本文是展示如何在Rstudio中使用rticles包的CTex模板完成中文pdf报告的渲染。 tinytex:tinytex::install_tinytex() rmarkdown、riticles:install.packages("rmarkdown")、install.packages("rticles 益辉大佬将很多杂志的Rmarkdown模板整理成rticles包,这样可以直接创建相应的RMarkdown模板,新建的CTex模板如图所示: ? 暂时也不确定是怎么回事,反正我去查看rticles包的github备份,里面的ctex也没有template.tex 由于RMarkdown的输出格式是在YAML头文件里面的output控制的,而相应的格式输出其实是调用相应的输出函数 pdf_document_format("ctex", latex_engine = latex_engine, ...) } YAML信息修改: # 模板的output头文件信息 output: rticles
下载好即可,无需双击打开)https://miktex.org/download下载TinyTeXinstall.packages("tinytex")下载rticlesinstall.packages("rticles ")背景知识rticles包内含有谢益辉编写的Rmarkdown模板,名字为CTeX,效果如图。 latex_engine: xelatex fig_caption: yes number_sections: yes toc: yes 做过的失败尝试1安装rticles 包rticles包提供了适用于各类场景的rmd模板,安装以后便可以选择支持中文的模板,在rstudio菜单栏中依次选择file->new file->R Markdown,然后选择下图所示的模板。 tinytex/issues/439划重点RMarkdown输出pdf首先需要latex的支持,因此要下载tinytex包,而此时输出pdf,则会出现“只有英文没有中文”的情况(936 error),此时安装rticles
--- title: "2020.08 Diary" author: - 庄闪闪 documentclass: ctexart always_allow_html: true output: rticles
除了默认的主题外,还可以通过加载rticles、prettydoc、rmdformats、tufte等包获取更多主题格式。下面我们看看几类扩展包里的主题样式。 4.1.rticles包 官网:https://github.com/rstudio/rticles; 具体教程:https://bookdown.org/yihui/rmarkdown/rticles-templates.html rticles软件包提供了各种期刊和出版商的模板: JSS articles (Journal of Statistical Software) R Journal articles CTeX documents author: - 庄闪闪 documentclass: ctexart geometry: "left=2cm,right=2cm,top=2cm,bottom=2cm" output: rticles
除了默认的主题外,还可以通过加载rticles、prettydoc、rmdformats、tufte等包获取更多主题格式。下面我们看看几类扩展包里的主题样式。 4.1.rticles包 官网:https://github.com/rstudio/rticles; 具体教程:https://bookdown.org/yihui/rmarkdown/rticles-templates.html rticles软件包提供了各种期刊和出版商的模板: JSS articles (Journal of Statistical Software) R Journal articles CTeX documents author: - 庄闪闪 documentclass: ctexart geometry: "left=2cm,right=2cm,top=2cm,bottom=2cm" output: rticles
author: - 庄闪闪 documentclass: ctexart geometry: "left=2cm,right=2cm,top=2cm,bottom=2cm" output: rticles
", dependencies = TRUE) # 安装完成之后运行 tinytex::install_tinytex() # 安装一些 RMarkdown 模板 install.packages("rticles
knitr:用于在PDF和HTML文档中嵌入R代码块 flexdashboard:基于rmarkdown,可以轻松的创建仪表盘 bookdown:以R Markdown为基础,用于创作书籍和长篇文档 rticles
knitr:用于在PDF和HTML文档中嵌入R代码块 flexdashboard:基于rmarkdown,可以轻松的创建仪表盘 bookdown:以R Markdown为基础,用于创作书籍和长篇文档 rticles
knitr:用于在PDF和HTML文档中嵌入R代码块 flexdashboard:基于rmarkdown,可以轻松的创建仪表盘 bookdown:以R Markdown为基础,用于创作书籍和长篇文档 rticles