Rmd:访问`yaml_metadata_block`

时间:2015-11-14 14:54:52

标签: r rstudio knitr r-markdown pandoc

R Markdown中,如何准确访问非标题yaml_metadata_block中的元数据?

我的尝试不太有效:

---
title: "My YAML block test"
output:
  pdf_document:
    md_extensions: +yaml_metadata_block
---

next we want to define some data on-the-fly using YAML:

---
myparam: somestring
---

And try using it in the document:

This is first attempt -  myparam is: $myparam$
This is second attempt - myparam is: `r print(myparam)`

0 个答案:

没有答案