css - RMarkdown:通过 CSS 折叠目录
问题描述
我有一个 Rmarkdown 文档,左侧有一个目录 (TOC)。
rmd 文件有一个 YAML 标头:
---
title: "Foo"
author: "Bar"
date: "`r format(Sys.time(), '%d-%B-%Y')`"
output:
html_document:
css: bam.css
theme: flatly
toc: true
---
这是 bam.css 的全部内容:
#TOC {
position: fixed;
left: 10px;
top: 10px;
width: 200px;
height: 100%;
overflow:auto;
}
#TOC::before {
content: "";
}
body {
max-width: 800px;
margin: auto;
margin-left:230px;
line-height: 20px;
}
有没有一种简单的方法来修改这个 CSS 以便 TOC 将手风琴?
解决方案
我发现最简单的方法是通过toc_float
YAML 标头。例如,:
output:
html_document:
theme: flatly
toc: true
toc_float: true
推荐阅读
- drupal-8 - 以编程方式在 Drupal8 中添加列表文本选项
- ios - 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序。删除表格单元格应用程序崩溃
- authentication - Apache atlas 2.1 配置连接cassandra后端 [求助]
- .net - google admanager api CustomTargetingService 删除键值对
- firebase - 如何使用 Firebase In App Messaging 从 Springboot 发送通知?
- python - 未选择 Youtube 标题数据。(在 selenium 中)
- git - 什么是编辑和管理我在亚马逊 EC2 上托管的网站的简单方法
- flutter - 找不到正确的提供者
在这个 xxxx 小部件上方 - unit-testing - 如何在结构内传递结构数组?
- file - 资产文件夹 Symfony 4 中的 CSS 和 JS 文件