我可以使用knitr編寫一個YAML頭文件來爲R Markdown文件生成多種輸出格式嗎?我無法複製the original question with this title答案中描述的功能。在knitr中指定多個同時輸出格式(新)
此降價文件:
---
title: "Multiple output formats"
output:
pdf_document: default
html_document:
keep_md: yes
---
# This document should be rendered as an html file and as a pdf file
生成一個PDF文件,但沒有HTML文件。
並且此文件:
---
title: "Multiple output formats"
output:
html_document:
keep_md: yes
pdf_document: default
---
# This document should be rendered as an html file and as a pdf file
產生一個HTML文件(和MD文件),但沒有PDF文件。
後面這個例子是original question的解決方案。我已經嘗試使用Shift-Ctrl-K和RStudio中的編織按鈕進行編織,並且調用rmarkdown::render
,但只創建單一輸出格式,而不管用於生成輸出文件的方法如何。
可能有關,但我不能確定解決方案:
- How do I produce R package vignettes in multiple formats?
- Render all vignette formats #1051
- knitr::pandoc can't create pdf and tex files with a single config #769
- Multiple formats for pandoC#547
- 暗指多種輸出格式支持在three year old RStudio blog post
基於R版本3.3.1(2016年6月21日),knitr 1.14,Rmarkdown 1.3
標題中的「(新)」是指哪裏?在'Windows NT'中是否是'knitr'的特殊版本,就像'NT'一樣 – Anthon
@Alnthon括號中的「new」是指這個問題與先前提出的問題(和回答)具有相同的標題。 – Jeff