Create tree list easily in Typst
contribution is welcomed!
#import "@preview/treet:0.1.1": *
#tree-list(
marker: content,
last-marker: content,
indent: content,
empty-indent: content,
marker-font: string,
content,
)
marker
- the marker of the tree list, default is[├─ ]
last-marker
- the marker of the last item of the tree list, default is[└─ ]
indent
- the indent aftermarker
, default is[│#h(1em)]
empty-indent
- the indent afterlast-marker
, default is[#h(1.5em)]
(same width as indent)marker-font
- the font of the marker, default is"Cascadia Code"
content
- the content of the tree list, includes at least a list
#tree-list[
- 1
- 1.1
- 1.1.1
- 1.2
- 1.2.1
- 1.2.2
- 1.2.2.1
- 2
- 3
- 3.1
- 3.1.1
- 3.2
]
#text(red, tree-list(
marker: text(blue)[├── ],
last-marker: text(aqua)[└── ],
indent: text(teal)[│#h(1.5em)],
empty-indent: h(2em),
)[
- 1
- 1.1
- 1.1.1
- 1.2
- 1.2.1
- 1.2.2
- 1.2.2.1
- 2
- 3
- 3.1
- 3.1.1
- 3.2
])
#show list: tree-list
#set text(font: "DejaVu Sans Mono")
root_folder\
- sub-folder
- 1-1
- 1.1.1 -
- 1.2
- 1.2.1
- 1.2.2
- 2