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

Allow customized titles #8

Closed
MagnusMG opened this issue Jan 29, 2025 · 3 comments
Closed

Allow customized titles #8

MagnusMG opened this issue Jan 29, 2025 · 3 comments

Comments

@MagnusMG
Copy link

The package was just what I wanted, but I'm not using typst very much and were unable to figure out a way of doing it myself, so many thanks for publishing this package!

However, I'm writing a document i Swedish and it looks weird to have a warning with a label in English. I tried to call the warning function with another title, without success. My workaround is to call the admonition function the same way as the warning function calls it, but with another value for the title argument:

#admonition(
   icon-path: "icons/alert.svg",
   title: "Varning",
   color: rgb(154, 103, 0)
)[
Detta avsnitt är experimentellt.
]

It is a bit cumbersome, though. Would it be hard to change the warning, info and other 'convenience methods' to allow for customised titles? Or to allow the user to specify titles as some kind of a setting?

@FlandiaYingman
Copy link
Owner

FlandiaYingman commented Feb 5, 2025

This has already been implemented in b830706, but sadly I forgot to submit it to Typst. I am submitting it now.

After it is accepted (or, you may download the sources and import them directly), you may update the package to 0.4.0 and write

#let warning = warning.with(title: "Varning")

#warning[
  Highlights information that users should take into account, even when skimming.
]

with result like

Image

@FlandiaYingman
Copy link
Owner

Submitted at typst/packages#1668. It should be ready as soon as it gets merged.

@FlandiaYingman
Copy link
Owner

Close as completed

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

No branches or pull requests

2 participants