How to create a nested list using the plain 'enum' or 'list' function?

Test 1, works fine:

#[
  #set enum(numbering: "1.a)")
  + aa
  + bb
    + xx
    + yy
]

Output:

1) aa
2) bb
   a) xx
   b) yy

Test 2. How to make it work the same as Test 1?

#enum(
  numbering: "1.a)",
  enum.item[aa],
  enum.item[bb],
  enum(
    numbering: "1.a)",
    enum.item[xx],
    enum.item[yy]
  )
)

The current output:

1) aa
2) bb
3) a) xx
   b) yy

The output I’m trying to achieve:

1) aa
2) bb
   a) xx
   b) yy

In the desired output, the sublist is part of the second item, so you need to build it so:

#enum(
  numbering: "1.a)",
  enum.item[aa],
  enum.item([bb] + enum(
    numbering: "1.a)",
    enum.item[xx],
    enum.item[yy]
  )),
)
1 Like