knitr - Losing R-Markdown title when automating knitting -


this question has answer here:

i trying automate creation of bunch of rmd files have been tediously knitting manually r-studio - using "knit html" button enabled when edit rmd file. if use knit2html command script, loses title. apparently explained design in post:

title not showing on r markdown knitr when rendering markdown file

however not explain how r-studio manages generate title in html files produces - must possible somehow, right? have been trying test.rmd r-markdown.

--- title: "my title" author: "joe programmer" date: "thursday, 10 june 2015" output: html_document ---  read instructions. 

and getting when use knit html button below

enter image description here

but when knit console knit2html()

enter image description here

how can code work way r-studio does?

rstudio answers here. can see template use @ this gist, , if @ markdown generation pane you'll see wicked long pandoc call made:

/usr/local/bin/pandoc forso.utf8.md    --to html    --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures    --output forso.html    --smart    --email-obfuscation none    --self-contained    --standalone    --section-divs    --template /library/frameworks/r.framework/versions/3.2/resources/library/rmarkdown/rmd/h/default.html    --variable 'theme:bootstrap'    --include-in-header /var/folders/2d/r3dsy9j17lqcctq5k0hmmg040000gn/t//rtmptthd32/rmarkdown-str16cec488b85bd.html    --mathjax --variable 'mathjax-url:https://cdn.mathjax.org/mathjax/latest/mathjax.js?config=tex-ams-mml_htmlormml'    --no-highlight    --variable highlightjs=/library/frameworks/r.framework/versions/3.2/resources/library/rmarkdown/rmd/h/highlight  

dig similar output on own system see else need pass own custom renderer desired output.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -