typst / typst

A new markup-based typesetting system that is powerful and easy to learn.
https://typst.app
Apache License 2.0
34.82k stars 927 forks source link

Add wavy and double underline functions #2835

Open Andrew15-5 opened 11 months ago

Andrew15-5 commented 11 months ago

Description

Comparing ulem LaTeX library to Typst, Typst already have underline and strikethrough. But it's missing some of the other well known styles like wavy/squiggly underline, double underline and some others.

image

Use Case

It would be great to have more underline styles to be able to make more customized notes, like text errors with red wavy underline, and some grammar examples, like dashed underline for one part of speech, wavy for another and double underline for a third one.

jpgklassen commented 4 months ago

@Andrew15-5 I accomplished this in Typst with the following line of markup:

#show link: it => underline(stroke: (dash: "dotted"), it)

A list of available "dash patterns" can be found here: https://typst.app/docs/reference/visualize/stroke/

Andrew15-5 commented 4 months ago

There are still no wavy and double lines. Everything else was present for a long time.

P.S. evade is true by default.

laurmaedje commented 4 months ago

I think a stroke based on a pattern might work.

Andrew15-5 commented 4 months ago

I think we already tried this approach when I created this. I don't remember what the result was. It was either just messy (more code than it should be) or it was show? Or both. Oh, wait, I remember that cetz was used for the stroke itself, but I don't know if pattern was used.

jpgklassen commented 4 months ago

P.S. evade is true by default.

Thanks for pointing that out, you are right, I have removed it. :)

I hope Typst adds support for wavy & double underlines soon!