在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)`