rmarkdown中的增量嵌套列表 [英] Incremental nested lists in rmarkdown

查看:72
本文介绍了rmarkdown中的增量嵌套列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在RMarkdown中制作一些幻灯片,并发现了有关嵌套列表和列表类型混合的奇怪行为.以下简短演示仅适用于幻灯片2.嵌套列表不再嵌套,并且混合混合增量有序和无序列表完全失败.我已经尝试了几种不同的演示格式,但是对于不同的输出类型,它实际上以不同的方式失败了,这令人惊讶.

I've been working in RMarkdown to make some slide sets, and have discovered odd behavior with respect to nested lists and mixing of list types. The following short presentation only works for slide 2. Nested lists are no longer nested and mixing incremental ordered and unordered lists fails entirely. I've tried this with a few different presentation formats, and it actually fails differently for different output types, which was surprising.

有想法吗?

---
title: "Attempt"
output: revealjs::revealjs_presentation
---

## Nested Incremental Lists

> * This
>   + kinda works (but is not nested)


##  Incremental Ordered Lists
> 1. This
> 2. works

## Broken - Nested mixed lists

> 1. This
>   + Does not work

推荐答案

尝试插入四个前导空格.从文档(重点是我):

Try inserting four leading spaces. From the documentation (emphasis mine):

四空间规则

The four-space rule

一个列表项可能包含多个段落和其他块级内容.但是,后续段落之前必须有一个空白行和缩进四个空格或一个制表符.如果第一段与其余段对齐,则列表看起来会更好:

A list item may contain multiple paragraphs and other block-level content. However, subsequent paragraphs must be preceded by a blank line and indented four spaces or a tab. The list will look better if the first paragraph is aligned with the rest:

与制表符数量不一致的原因可能是由于Rstudio默认插入了多少空格.

The inconsistency to do with number of tabs may be due to how many spaces are inserted by default by Rstudio.

这篇关于rmarkdown中的增量嵌套列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆