I am trying to automate the creation of a bunch of Rmd files that I have been tediously knitting manually with R-Studio - using the "Knit HTML" button that is enabled when you edit an Rmd file. However if I use the knit2html
command from a script, it loses the title. This is apparently explained as by design in this post:
Title not showing on R Markdown with knitr when rendering markdown file
However it does not explain how R-Studio manages to generate the title in the html files it produces - it must be possible somehow, right? I have been trying with this test.Rmd
R-markdown.
---
title: "My Title"
author: "Joe Programmer"
date: "Thursday, 10 June 2015"
output: html_document
---
Just read the instructions.
And getting this when I use the Knit HTML button below
But this when I knit from the console with knit2html()
How can I get my code to work the way R-Studio does?
RStudio answers that here. You can see the template they use at this gist, and if you look at the markdown generation pane you'll see that eventually a wicked long
pandoc
call is made:Dig into that similar output on your own system to see what else you need to pass to your own custom renderer to get the desired output.