'How to produce both .html and .md from an .Rmd (Rmarkdown) and rename them?

I know making .Rmd produce .html file or .md file should use the following codes

---
title: "report"
output: html_document
---

or

---
title: "report"
output: md_document
---

But how to produce the two at the same time? I try the following, but it is not working

---
title: "report"
output: html_document, md_document
---

Another issue is that, how can I make the name of the .html file (or .md file) produced different from the .Rmd file? For example, I have sample.Rmd, but I want the .md file to be named as sample_1.md.



Solution 1:[1]

You can use keep_md: yes to keep the md file while still getting other output. So the YAML will be something like

---
title: "report"
author: "me"
date: '2016-04-25'
output:
  html_document:
    keep_md: yes
---

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Richard Telford