r - Enable rmarkdown / pandoc-citeproc citations in Jekyll blog via servr -
i'm basing rmarkdown
-jekyll-blog off of yihui's fantastic boilerplate using servr::jekyll()
, in turn wraps knitr
.
everything's dandy, except can't rmarkdown
-citations work (which in turn wrap pandoc-citeproc
, believe).
so when add bibliography.bib
@manual{yihui-2015, title = {knitr: general-purpose package dynamic report generation in r}, author = {yihui xie}, year = {2015}, note = {r package version 1.11}, url = {http://yihui.name/knitr/}, }
to directory, amend preamble of boilerplate 2014-09-28-jekyll-with-knitr.rmd
bibliography: ../bibliography.bib
or bibliography: bibliography.bib
(see below) , add boilerplate itself:
## citations work this: [@yihui-2015] see references @ bottom.
this get:
[
just confirm setup is, in fact, correct, ran
library(rmarkdown) render(input = "_source/2014-09-28-jekyll-with-knitr.rmd")
which produces html with citations, expected:
[
in way, not surprising, because according boilerplate
r markdown source files re-compiled through knitr when corresponding markdown output files become older1 source files;
so servr::jekyll
runs files through knitr
not deal citations, , not rmarkdown::render
, does.
how can work and/or worthwhile addition servr
?
ps.: rmarkdown::render
, other things equal, executed in own r session (right?), working directory being the directory of rendered file, need ../bibliography.bib
work. think servr::jekyll
which runs root of blog directory use working directory in r session , can hence find bibliography.bib
. wrong. anyway, detail, , not @ heart of problem here.
turns out, had not read manual enough:
rmdv2()
instead of jekyll()
answer question.
from manual:
the functions rmdv1() , rmdv2() similar jekyll(), , difference way compile r markdown documents: rmdv1() uses markdown package (a.k.a r markdown v1) via knit2html(), , rmdv2() calls render() in rmarkdown package (a.k.a r markdown v2).
because pandoc
-style citations introduce in r markdown v2, need rmdv2()
.
Comments
Post a Comment