0

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?

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
umair durrani
  • 5,597
  • 8
  • 45
  • 85

1 Answers1

1

RStudio version 0.98.501 does not support the rmarkdown package. You have to check out the latest preview version (at this moment, v0.98.894).

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
  • Thanks for your reply @Yihui. But in my case rmarkdown IS working perfectly fine on the version 0.98.501. I was wondering what is the difference between the 2 options? – umair durrani Jun 06 '14 at 21:20
  • I have update RStudio to v.0.98.894 and when I knitHtml to above file, it works fine. But when I add an external image e.g. `![alt text](C:/Users/durraniu/Documents/Trajectory1/images/vissim-view.png)` it does not work and gives the error `pandoc.exe: Failed to retrieve C:/Users/durraniu/Documents/Trajectory1/images/vissim-view.png InvalidUrlException "C:/Users/durraniu/Documents/Trajectory1/images/vissim-view.png" "Invalid scheme" Error: pandoc document conversion failed with error 61` What does this mean? – umair durrani Jun 06 '14 at 21:56
  • @umairdurrani Never use absolute paths unless you absolutely have to. Use relative paths whenever you can. Rstudio 0.98.501 actually uses something like the markdown package (http://cran.rstudio.com/package=markdown), instead of rmarkdown. – Yihui Xie Jun 07 '14 at 04:28