简体   繁体   English

如何打破长R降价文件

[英]How to break a long R markdown document

I often find that in using RStudio R markdown, the resulting HTML can get quite long and heavy. 我经常发现在使用RStudio R markdown时,生成的HTML会变得非常冗长。 What strategies can someone use to break down or otherwise manage long documents? 有人可以使用什么策略来分解或管理长文档?

Create a table of contents (TOC) to move quickly to the different sections of your document. 创建目录(TOC)以快速移动到文档的不同部分。 You do it by requesting a toc in the doc header, something like this: 您可以通过在doc标头中请求toc来实现,如下所示:

---
title: "MyDoc"
output:
  html_document:
    toc: yes
---

Instead of being stuck at the top of a long document you can also produce a “floating toc" by adding a custom css-file. Have a look at this example . 您可以通过添加自定义css文件来生成“浮动toc”,而不是卡在长文档的顶部。看看这个示例

This is the default behavior of bookdown . 这是bookdown的默认行为。 See Chapter 3 of its documentation for details. 有关详细信息,请参阅其文档的第3章 In particular, look for the option split_by in 3.1.1 and 3.4. 特别是,在3.1.1和3.4中查找split_by选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM