Lovelace

→ Universe

Booktabs

If you like wrapping your algorithm in elegant horizontal lines, you can do so by setting the booktabs option to true.

#pseudocode-list(booktabs: true)[
+ do something
+ do something else
+ *while* still something to do
+ do even more
+ *if* not done yet *then*
+ wait a bit
+ resume working
+ *else*
+ go home
+ *end*
+ *end*
]
page12-example0

Together with the title option, you can produce

#pseudocode-list(booktabs: true, title: [My cool title])[
+ do something
+ do something else
+ *while* still something to do
+ do even more
+ *if* not done yet *then*
+ wait a bit
+ resume working
+ *else*
+ go home
+ *end*
+ *end*
]
page12-example1

Stroke

By default, the outer booktab strokes are text.fill + 2pt. You can change that with the option booktabs-stroke to any valid Typst stroke. The inner line will always have the same stroke as the outer ones, just with half the thickness.

Inset

By setting the title-inset option, you can specify the space around the title:

#pseudocode-list(booktabs: true, title: [My cool title], title-inset: 2em)[
+ do something
+ do something else
+ *while* still something to do
+ do even more
+ *if* not done yet *then*
+ wait a bit
+ resume working
+ *else*
+ go home
+ *end*
+ *end*
]
page12-example2