andreasKroepelin / lovelace

A Typst package for typesetting pseudocode
MIT License
40 stars 2 forks source link

Make styling of individual parts configurable #17

Open tingerrr opened 1 month ago

tingerrr commented 1 month ago

It would be great if one could configure styling of individual components, I haven't looked at the source code, but I have a hunch it may be implemented using a table since it used a repeatable header, so some styling can be applied automatically. But this can't easily be configured or inferred from the docs.

I'm asking because I ran into this: image The algorithm header was justified, I was able to fix this by passing par(justify: false)[...], but this gets cumbersome quickly.

andreasKroepelin commented 1 month ago

In your case specifically, I assume that the surrounding document was justified? Something like

#show figure.where(kind: "algorithm"): set par(justified: false)

could do the trick then.

Maybe Lovelace should put a

#set par(justified: false)

before any pseudocode 🤔

For more general configurability, it's probably a good idea to wait for custom types in Typst. And yes, Lovelace uses a #grid to layout pseudocode.

tingerrr commented 1 month ago

I think that's likely enough, but it should, at the very least, be documented. But I also figured applying styling to parts of it, by adding show rule like hooks, could make the API more flexible.

But waiting for custom types is fine, too. It'll just take a while.