andreasKroepelin / lovelace

A Typst package for typesetting pseudocode
MIT License
43 stars 3 forks source link

`#algorithm` makes code centered and missing horizontal lines. #7

Closed RomeoV closed 4 months ago

RomeoV commented 4 months ago

First of all, thanks for this package, it looks great!

I'm trying to compile one of the examples. I have, in an otherwise empty document:

#import "@preview/lovelace:0.2.0": *
#algorithm(
  caption: [The Euclidean algorithm],
  pseudocode(
    no-number,
    [*input:* integers $a$ and $b$],
    no-number,
    [*output:* greatest common divisor of $a$ and $b$],
    [*while* $a != b$ *do*], ind,
      [*if* $a > b$ *then*], ind,
        $a <- a - b$, ded,
      [*else*], ind,
        $b <- b - a$, ded,
      [*end*], ded,
    [*end*],
    [*return* $a$]
  )
)

However, all the text is centered, and I am missing the horizontal lines that the examples had. Any ideas?

screenshot_2024-05-26T01:55:14UTC

andreasKroepelin commented 4 months ago

From the readme:

Note that such figures are only displayed correctly when you used the setup function mentioned above!

RomeoV commented 4 months ago

Oops, sorry for that! "Fixed".