Knit with custom parameters

孤者浪人 提交于 2020-02-07 02:01:36

问题


I can't get rmarkdown::render to take my params argument as in https://bookdown.org/yihui/rmarkdown/params-knit.html#knit-with-custom-parameters

A minimal example of an Rmd called re.Rmd:

---
title: "Untitled"
output:
  pdf_document:
    template: def.tex
params:
  title: "different"
---

I changed the default pandoc latex template: pandoc -D latex > def.tex

$if(title)$
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
$endif$

to

$if(params.title)$
\title{$params.title$$if(thanks)$\thanks{$thanks$}$endif$}
$endif$

But if I run rmarkdown::render, it ignores the params

rmarkdown::render("Documents/thesis/test/re.Rmd",params=list(title="very different"))

来源:https://stackoverflow.com/questions/59987994/knit-with-custom-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!