Nested numbered and lettered lists in ioslides

I am struggling to answer something that ought to be obvious. Normally, in rmarkdown, if I want a list like:

  1. item 1
    a. sub-item a.
    b. sub-item b.
  2. item 2

I type:

  1. item 1
    <4spaces>a. sub-item a.
    <4spaces>a. sub-item b.
  2. item 2

That works perfectly for html and latex, but in ioslides, I get, instead:

  1. item 1
    1. sub-item a.
    2. sub-item b.
  2. item 2

I cannot figure out how to fix this, and I have not seen anything on stack overflow or anywhere else.

Hi @steve_koch! Welcome!

I'm not sure exactly why mixing ordered list types doesn't work in an ioslides_presentation, but one workaround is to use HTML (I know, so verbose! :weary:)

---
title: "IOSlides Lists"
output: ioslides_presentation
---

## Slide with Lists

1. item 1
   a. sub-item a.
   b. sub-item b.
2. item 2


<ol>
<li>item 1
<ol type='a'>
<li>sub-item a.</li>
<li>sub-item b.</li>
</ol>
</li>
<li>item 2</li>
</ol>

Aha, here's why list numbering doesn't work as you expected in an ioslides_presentation:

Regular HTML documents are rendered from markdown into HTML by pandoc, using its fancy_lists extension that makes it sensitive to the type of marker you use in your markdown.

However ioslides is not a pandoc-native presentation format. So the step where pandoc converts the markdown to HTML happens via a custom Lua writer included in rmarkdown. Although this Lua writer could be adapted to change its output based on what pandoc knows about the type of ordered list, the filter as currently written does not make use of that information:

You could try. submitting a feature request (or even a pull request) to rmarkdown to see if there's interest in taking this up!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.