Hello!
The obvious solution for this would be to set the list indent right before each usage.
some text
#set list(indent: 1em)
- item 1
- item 2
#set list(indent: 0em)
some text:
- item 1
- item 2
A more automatic solution would be to use custom checkmarks. @OrangeX4 has implemented this, and I am shamelessly using his code :)
#show list.item: it => {
// https://github.com/OrangeX4/typst-cheq/blob/main/lib.typ
// The body should be a sequence
if not (type(it.body) == content and it.body.func() == [].func()) {
return it
}
let children = it.body.children
// A checklist item has at least 5 children: `[`, markder, `]`, space, content
if children.len() < 5 or not (children.at(0) == [#"["] and children.at(2) == [#"]"] and children.at(3) == [ ]) {
return it
}
// Process
show list: set block(height: 0em) // Typst v0.12
let marker = children.at(1).text
if marker == "I" {
list(indent: 1em, children.slice(4).sum())
}
}
some text
- [I] item 1
- [I] item 2
some text:
- item 1
- item 2
I would suggest putting the set in a scope instead of manually resetting it:
some text
#[
#set list(indent: 1em)
- item 1
- item 2
]
#set list(indent: 0em)
some text:
- item 1
- item 2
However, your response still misses a crucial part: how can you automatically detect whether a list is “attached” to the preceding paragraph? So that a single rule could style both lists accordingly.
@Carlos, I have adjusted the title accordingly, because I think it could have been mistaken for asking about nested lists:
- top-level
- not top-level
I hope this way it gets some additional attention. Just lmk or change it again if I missed your intent with that change.