我在同一个文件夹中有两个文件:chapter1.Rmd和chapter2.Rmd,它们的内容如下:
chapter1.Rmd
---
title: "Chapter 1"
output: pdf_document
---
## This is chapter 1. {#Chapter1}
Next up: [chapter 2](#Chapter2)
第二章.Rmd
---
title: "Chapter 2"
output: pdf_document
---
## This is chapter 2. {#Chapter2}
Previously: [chapter 1](#Chapter1)
如何将它们编织在一起形成单个的PDF输出?
当然,render(input = "chapter1.Rmd", output_format = "pdf_document")
可以完美地工作,但是 render(input = "chapter1.Rmd", input = "chapter2.Rmd", output_format = "pdf_document")
则不行。
我为什么要这样做?是为了将一个巨大的文档拆分成逻辑文件。
我已经使用了@hadley的bookdown包从.Rmd构建LaTeX,但这似乎对于这个特定的任务来说太过浩大。是否有一个使用knitr/pandoc/linux命令行的简单解决方案我错过了?谢谢。