有谁知道如何在 rmarkdown 中增加 float 目录的宽度,以便它可以在一行中显示所有标题而不会中断。 这是一个例子:
---
title: "Title"
author: "Author "
date: '`r format(Sys.Date(), "%B %d, %Y")`'
output:
html_document:
toc_float: true
toc: true
number_sections: true
code_folding: show
theme: lumen
editor_options:
chunk_output_type: console
---
# A loooooooooooooooooooooooong title
谢谢
最佳答案
我的诀窍是更改 float 目录的 CSS 样式。您可以使用 CSS 代码块将 CSS 规则直接嵌入到您的 Rmd 文档中。例如,像这样:
title: "XY"
author: "XX"
date: '`r format(Sys.Date(), "%B %d, %Y")`'
output:
html_document:
toc: true
theme: united
toc_depth: 4
toc_float: true
.tocify .tocify-header {
position: fixed;
top: 50px;
left: 50px;
width: 500px;
height: 200px;
}
或者您可以将其包含在自定义样式表中:
output:
html_document:
css: "style.css"
关于r-markdown - 增加 rmarkdown 中目录的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58391554/