l

lovelace

@preview

Algorithms in pseudocode, unopinionated and flexible.

v0.3.1
MIT
3 downloads

Package Information

Last Updated
Minimum Typst Version
0.13.0
Categories
components
Disciplines
computer-sciencemathematics

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/lovelace:0.3.1

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/lovelace:0.3.1": *

Version History

0.3.10.13.0
a589122439c8...
0.3.0
32cd189feeaa...
0.2.0
067cd3b99293...
0.1.0
f8c5013543d0...

Lovelace

This is a package for writing pseudocode in Typst.
It is named after the computer science pioneer
Ada Lovelace and inspired by the
pseudo package for LaTeX.

toot
GitHub license
GitHub release (latest by date)
GitHub Repo stars

Pseudocode is not a programming language, it doesn't have strict syntax, so
you should be able to write it however you need to in your specific situation.
Lovelace lets you do exactly that.

Main features include:

  • arbitrary keywords and syntax structures
  • optional line numbering
  • line labels
  • lots of customisation with sensible defaults

Getting started

Import the package using

#import "@preview/lovelace:0.3.1": *

The simplest usage is via pseudocode-list which transforms a nested list
into pseudocode:

#pseudocode-list[
  + 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*
]

resulting in:

simple

As you can see, every list item becomes one line of code and nested lists become
indented blocks.
There are no special commands for common keywords and control structures, you
just use whatever you like.

To learn more about how to use and customize Lovelace,
visit the tutorial.