2

Take the following minimal example. The numbering of the list restarts to 1 in slide 2, when I wanted that the list of slide 2 started with 2. I tried, after intensive Google search, a suggestion given at R Markdown Presentation: How to continue a numbered list across a slide? (see slide 3 and slide 4, below), but with no luck. Thanks!

---
title: "Presentation Ninja"
subtitle: "&#x2694;&#xFE0F; xaringan +<br/>&#x1F60E; xaringanthemer"  
author: 
  - "Yihui Xie"
  - "Garrick Aden-Buie"
date: '`r Sys.Date()`'
output:
  xaringan::moon_reader:
    css: xaringan-themer.css
    nature:
      slideNumberFormat: "%current%"
      highlightStyle: github
      highlightLines: true
      ratio: 16:9
      countIncrementalSlides: true
---

```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
knitr::opts_chunk$set(
  fig.width=9, fig.height=3.5, fig.retina=3,
  out.width = "100%",
  cache = FALSE,
  echo = TRUE,
  message = FALSE, 
  warning = FALSE,
  hiline = TRUE
)
```

```{r xaringan-themer, include=FALSE, warning=FALSE}
library(xaringanthemer)
style_duo_accent(
  primary_color = "#1381B0",
  secondary_color = "#FF961C",
  inverse_header_color = "#FFFFFF"
)
```

## slide 1

1. firt item
    - sub-item

---
## slide 2

2. second item
    - sub-item
    
---
## slide 3

<ol>
<li> Sed ut perspiciatis unde omnis iste natus error...
<li> Nemo enim ipsam voluptatem quia voluptas sit...
</ol>

---
## slide 4

<ol start=3>

<ol>
<li> Sed ut perspiciatis unde omnis iste natus error...
<li> Nemo enim ipsam voluptatem quia voluptas sit...
</ol>
PaulS
  • 21,159
  • 2
  • 9
  • 26

1 Answers1

1

Mr. Paul, hello :)

You should remove a redundant tag <ol>, when using <ol start = "3">

Code:

---
## slide 3

<ol>
<li> Sed ut perspiciatis unde omnis iste natus error...
<li> Nemo enim ipsam voluptatem quia voluptas sit...
</ol>

---
## slide 4

<ol start="3">

<li> Sed ut perspiciatis unde omnis iste natus error...
<li> Nemo enim ipsam voluptatem quia voluptas sit...
</ol>

Output:

enter image description here

An addition:

## slide 4

<ol start="3">
3. Sed ut perspiciatis unde omnis iste natus error... <br>
<p style="margin-left: 25px;"> &#9675;(or &#9702;) sub-item </p>
4. Nemo enim ipsam voluptatem quia voluptas sit...
</ol>
manro
  • 3,529
  • 2
  • 9
  • 22
  • Thanks, again, my saviour @manro! And why does not the following work? `
      3. Sed ut perspiciatis unde omnis iste natus error... 4. Nemo enim ipsam voluptatem quia voluptas sit...`
    – PaulS Jan 08 '22 at 15:16
  • 1
    @PaulSmith It works, look to an addition... – manro Jan 08 '22 at 15:26
  • But, with nested unnumbered sub-items, apparently no, @manro: `3. Sed ut perspiciatis unde omnis iste natus error... - sub-item ` – PaulS Jan 08 '22 at 15:30
  • 1
    @PaulSmith Maybe this? Look above ^ – manro Jan 08 '22 at 15:40
  • 1
    Thanks, @manro! Can the sub-item be indented with an empty-filled bullet mark: `-- Sed ut perspiciatis unde omnis iste natus error... Nemo enim ipsam voluptatem quia voluptas sit... Sed ut perspiciatis unde omnis iste natus error... Nemo enim ipsam voluptatem quia voluptas sit...` ? – PaulS Jan 08 '22 at 15:52
  • 1
    @PaulSmith Yes, it works. You can try (see addition) – manro Jan 08 '22 at 19:28