【发布时间】:2015-08-07 10:33:43
【问题描述】:
我最近打开了一个标准的 Rmd 文件,没有进行任何编辑。默认文件如下所示:
Untitled.rmd
---
title: "myfile"
author: "Me"
date: "May 25, 2015"
output: html_document
fontsize: 12pt
---
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
我想创建一个与上述文件相对应的 html 文件,所以在一个单独的 R 脚本中我做了以下操作:
knit('Untitled.Rmd', 'doc.md')
markdownToHTML('doc.md', 'testing.html',header = TRUE)
由于某种原因,字体大小不起作用,并且我希望的标题信息没有出现在我的 testing.html 中。有人知道为什么会这样吗?
【问题讨论】:
-
我相信
fontsize是rmarkdown(不是knitr)中的纯LaTeX 元数据变量,如rmarkdown.rstudio.com 所示。 (我的 Rstudio 版本——0.98.1103——不包括那个选项,你是修改了文档的 YAML 头还是从不同的包中获取了模板?)也许你可以看看customizing the CSS。
标签: css r fonts r-markdown