Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add script letters #38

Merged
merged 2 commits into from
Feb 19, 2024
Merged

feat: add script letters #38

merged 2 commits into from
Feb 19, 2024

Conversation

xkevio
Copy link
Contributor

@xkevio xkevio commented Feb 18, 2024

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.

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 johanvx added the enhancement New feature or request label Feb 19, 2024
@johanvx
Copy link
Owner

johanvx commented Feb 19, 2024

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?

#figure(
table(
columns: (1fr, 2fr),
[??], [Unavailable until typst #sys.version.],
)
) <unavailable>

@xkevio
Copy link
Contributor Author

xkevio commented Feb 19, 2024

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?

#figure(
table(
columns: (1fr, 2fr),
[??], [Unavailable until typst #sys.version.],
)
) <unavailable>

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
Copy link

Enivex commented Feb 19, 2024

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
Copy link
Owner

johanvx commented Feb 19, 2024

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.

@johanvx johanvx merged commit d314d33 into johanvx:main Feb 19, 2024
2 checks passed
@istudyatuni
Copy link

Seems like README should also be updated

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants