【发布时间】:2019-08-19 07:46:20
【问题描述】:
我正在写 rmarkdown 并导出到 odt 和 html。我可以在生成的html 中获得一个 TOC,我可以在生成的odt 中获得一个 TOC,但是我不能同时在两者中获得一个 TOC,因为代码似乎是互斥的。
如何在odt 和html 中使用相同的Rmd 文件生成TOC?
这是我在odt 中获取 TOC 的方法:
---
title: Test TOC
toc: yes
toc-title: TOC
output:
odt_document:
keep_md: true
html_document:
number_sections: true
---
# Just a test document
With some text
这是我在html 中获取 TOC 的方法:
---
title: Test TOC
output:
odt_document:
keep_md: true
html_document:
toc: yes
toc-title: TOC
number_sections: true
---
# Just a test document
With some text
如果我将两者结合起来,我会在html 中得到“是”作为 TOC。
我正在使用rmarkdown 1.12 和pandoc-2.7.3
【问题讨论】:
标签: r-markdown pandoc