I am using RStudio version 0.98.501, R version 3.0.2 on Windows 7. I have following code written in a .Rmd file:
---
title: "Sample Document"
output:
html_document:
toc: true
theme: united
---
Title
========================================================
This is an R Markdown document. Markdown is a simple formatting syntax for authoring web pages (click the **Help** toolbar button for more details on using R Markdown).
When you click the **Knit HTML** button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r fig.width=7, fig.height=6}
plot(cars)
```
Literature Review
==================
this is sample text
Hello
------
World!
### Subsection
this is subsection
When I click knitHtml
button the created html file DOES NOT contain the table of contents. However when I use following code, it creates the table of contents and change the theme to united
:
rmarkdown::render('C:/Users/durraniu/Documents/Trajectory1/knitHtml/test.Rmd')
What is the difference and how can I make knitHtml button work the way the code does?