johanvx / typst-undergradmath

A Typst port of undergradmath
Creative Commons Attribution Share Alike 4.0 International
109 stars 7 forks source link

feat: add script letters #38

Closed xkevio closed 6 months ago

xkevio commented 7 months ago

Getting script letters akin to $\mathscr(P)$ is actually possible in Typst. It consists of changing the stylistic-set of the text() function to swap out the normal calligraphic set unicode range.

Which set that is, depends on the font used. In this case it's 1. Adding this sentence would offset the footer and move it to a third page but I propose just removing the unavailable annotation as it is no longer needed after this and puts everything neatly back into two pages.

johanvx commented 6 months ago

Thanks!

It would be better to define a scr() function (just like the cosec example), but it seems that there's currently a related issue (see typst/typst/issues/3379). Let's just adopt the simple show approach for now.

Adding this sentence would offset the footer and move it to a third page but I propose just removing the unavailable annotation as it is no longer needed after this and puts everything neatly back into two pages.

Would you mind commenting out the @unavailable annotation in this pull request?

https://github.com/johanvx/typst-undergradmath/blob/65542d7f13264b4631725a58f3c0539577688ac4/undergradmath.typ#L90-L95

xkevio commented 6 months ago

Thanks!

It would be better to define a scr() function (just like the cosec example), but it seems that there's currently a related issue (see typst/typst/issues/3379). Let's just adopt the simple show approach for now.

Adding this sentence would offset the footer and move it to a third page but I propose just removing the unavailable annotation as it is no longer needed after this and puts everything neatly back into two pages.

Would you mind commenting out the @unavailable annotation in this pull request?

https://github.com/johanvx/typst-undergradmath/blob/65542d7f13264b4631725a58f3c0539577688ac4/undergradmath.typ#L90-L95

Yeah, I briefly considered the function approach as it would be nicer overall but the mentioned issue, which I actually explored with @Enivex, is a stopper for now. As for removing the @unavailable notation, I did do that but that also means the figure numbering has to be adjusted (which I did too) as otherwise all Tricky's would turn into the ??-thing.

Enivex commented 6 months ago

Another issue with defining a scr function is that the mechanism for accessing the script glyphs varies from font to font. So even when the issue is fixed, you would need to hard-code the font (or a list of fonts).

johanvx commented 6 months ago

Yeah, I briefly considered the function approach as it would be nicer overall but the mentioned issue, which I actually explored with @Enivex, is a stopper for now. As for removing the @unavailable notation, I did do that but that also means the figure numbering has to be adjusted (which I did too) as otherwise all Tricky's would turn into the ??-thing.

That's great! Thanks again!

Another issue with defining a scr function is that the mechanism for accessing the script glyphs varies from font to font. So even when the issue is fixed, you would need to hard-code the font (or a list of fonts).

Thanks for your explanation! I understand it better.

istudyatuni commented 6 months ago

Seems like README should also be updated

  • [ ] Script letters, such as form \mathscr{P}, are unavailable