6

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 Answer 1

8

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I used rmarkdown:render(inputfile.Rmd, "html_document") and it worked like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.