最好,我想使用一种不依赖VBA/VBS的解决方案,而是使用RMarkdown和(如有必要)仅使用reference_docx文件.解决方案如此处,基于此和此,您可以在Word文档中更改日期的样式,以在日期之后添加分页符.当然,这只会将标题页与目录分开,并且如果您想在这两个目录之间插入其他页面,则不会起作用.但这至少是一个主意.When an RMarkdown document is knit to Word, the Table of Contents (if there is one) always appears at the beginning of the document. If I want to, say, make the Table of Contents appear on the second page of the document, how do I do so?If I was knitting to HTML I could use this method, but it doesn't seem to work for Word. Meaning, I create a Word template to be used in the reference_docx YAML argument and put the Table of Contents at the bottom of this template, but when I knit a report the Table of Contents appears at the front of the document.Preferably, I'd like to use a solution that doesn't rely on VBA/VBS and instead uses RMarkdown and (if necessary) a reference_docx file only. 解决方案 As explained here, based on this and this, you could change the style of the date in the Word document to add a page break after it.Of course, that only separates the title page from the table of contents and if you want to insert other pages between those two, it wouldn't work.But at least that's an idea to start from. 这篇关于在RMarkdown Word文档中,如何使目录在以后出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-31 07:07