HTML outputs are different between using knitr in

2019-04-28 20:25发布

问题:

I am trying to generate html documents from R markdown files using knitr.

When I use the knit html button in R studio it works fine and it gets me the desired output.

However when I use knit2html() in the commandline, the formatting of the output html is different (less prettier) than that obtained from rstudio.

Can you tell me what are the exact options and functions that are being used when I press the knit html button?

I wanted to include images, but apparently my "reputation" is too low...

Basically, the major difference are :

1) code chunks and outputs have smoother edges

2) header is included.

3) Font sizes

回答1:

Now RStudio uses R Markdown v2 by default, and knitr::knit2html() still uses R Markdown v1. V2 uses Pandoc and Twitter Bootstrap themes, which are prettier than the style in v1.



标签: r knitr rstudio