问题
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