Tdtr: a package for drawing beautiful tidy tree easily

Hello,

I have been developing a Typst package as an alternative to the forest macro in LaTeX but more easily to get started and customize.

And here it is tdtr - Typst package for drawing beautiful tidy tree easily.

You do not need to write complex nested square brackets, but just write the tree as a view of bullet lists.

Also, it’s based on fletcher, so it’s convenient to customize your nodes and edges according to the manual of fletcher.

Hope you can enjoy this package and provide some suggestions for improvement!

18 Likes

Damnnn nice!! I always wanted somehting like this, as cetz.tree always left something to be desired in terms of convenience. Thank you!

1 Like

建议给到夯 :laughing: 太需要了

As a user of the forest package who has been moving some of his LaTeX to Typst, I’ve been delighted with tdtr. It isn’t quite as powerful, but much easier to use and customize.
My only gripe is that I still think that edges shouldn’t be arrows by default (even at the cost of a breaking change :wink:).

2 Likes

One quick way of achieving this would be to redefine tidy-tree-graph to use plain edges:

#let tidy-tree-graph = tidy-tree-graph.with(draw-edge: (marks: "-"))

Yes, that’s what I’m doing:

#let basic-tree = tidy-tree-graph.with(
  draw-edge: (marks: "-"),
  draw-node: (stroke: 0pt),
)

I just feel that this should be the default and am lobbying for it before version 1.0 hits.

3 Likes

To disable stroking use none (or for fill), if a package can handle it.

1 Like