t

treet

@preview

Create tree lists easily

v1.0.0
MIT

Package Information

Last Updated
Minimum Typst Version
0.10.0
Authors
8LWXpg
Categories
componentslayout

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/treet:1.0.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/treet:1.0.0": *

Version History

1.0.00.10.0
0faaf2de4e2c...
0.1.10.10.0
1fdc847a475e...
0.1.00.10.0
d11b147d1110...

Treet

GitHub manifest version (path) GitHub Repo stars GitHub typst package

Create tree list easily in Typst

contribution is welcomed!

Usage

#import "@preview/treet:1.0.0": *

#tree-list(
  marker:       content,
  last-marker:  content,
  indent:       content,
  empty-indent: content,
  marker-font:  string,
  content,
)

Parameters

  • 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 after marker, default is [│#h(1em)]
  • empty-indent - the indent after last-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

Demo

see demo.typ demo.pdf

Default style

#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
]

1.png

Custom style

#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
])

2.png

Using show rule

#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

3.png