GithubHelp home page GithubHelp logo

packages's Introduction

Typst Packages

The package repository for Typst, where package authors submit their packages. The packages submitted here are available on Typst Universe.

Package format

A package is a collection of Typst files and assets that can be imported as a unit. A typst.toml manifest with metadata is required at the root of a package. An example manifest could look like this:

[package]
name = "example"
version = "0.1.0"
entrypoint = "lib.typ"
authors = ["The Typst Project Developers"]
license = "MIT"
description = "An example package."

Required by the compiler:

  • name: The package's identifier in its namespace.
  • version: The package's version as a full major-minor-patch triple. Package versioning should follow SemVer.
  • entrypoint: The path to the main Typst file that is evaluated when the package is imported.

Required for submissions to this repository:

  • authors: A list of the package's authors. Each author can provide an email address, homepage, or GitHub handle in angle brackets. The latter must start with an @ character, and URLs must start with http:// or https://.
  • license: The package's license. Must contain a valid SPDX-2 expression describing one or multiple OSI-approved licenses.
  • description: A short description of the package. Double-check this for grammar and spelling mistakes as it will appear in the [package list][list].

Optional:

  • homepage: A link to the package's web presence, where there could be more details, an issue tracker, or something else. Will be linked to from the package list.
  • repository: A link to the repository where this package is developed. Will be linked to from the package list if there is no homepage.
  • keywords: An array of search keywords for the package.
  • categories: An array with up to three categories from the list of categories to help users discover the package.
  • disciplines: An array of disciplines defining the target audience for which the package is useful. Should be empty if the package is generally applicable.
  • compiler: The minimum Typst compiler version required for this package to work.
  • exclude: An array of globs specifying files that should not be part of the published bundle that the compiler downloads when importing the package. To be used for large support files like images or PDF documentation that would otherwise unnecessarily increase the bundle size. Don't exclude the README or the LICENSE.

Packages always live in folders named as {name}/{version}. The name and version in the folder name and manifest must match. Paths in a package are local to that package. Absolute paths start in the package root, while relative paths are relative to the file they are used in.

Templates

Packages can act as templates for user projects. In addition to the module that a regular package provides, a template package also contains a set of template files that Typst copies into the directory of a new project.

In most cases, the template files should not include the styling code for the template. Instead, the template's entrypoint file should import a function from the package. Then, this function is used with a show rule to apply it to the rest of the document.

Template packages (also informally called templates) must declare the [template] key in their typst.toml file. A template package's typst.toml could look like this:

[package]
name = "charged-ieee"
version = "0.1.0"
entrypoint = "lib.typ"
authors = ["Typst GmbH <https://typst.app>"]
license = "MIT-0"
description = "An IEEE-style paper template to publish at conferences and journals for Electrical Engineering, Computer Science, and Computer Engineering"

[template]
path = "template"
entrypoint = "main.typ"
thumbnail = "thumbnail.png"

Required by the compiler:

  • path: The directory within the package that contains the files that should be copied into the user's new project directory.
  • entrypoint: A path relative to the template's path that points to the file serving as the compilation target. This file will become the previewed file in the Typst web application.

Required for submissions to this repository:

  • thumbnail: A path relative to the package's root that points to a PNG or lossless WebP thumbnail for the template. The thumbnail must depict one of the pages of the template as initialized. The longer edge of the image must be at least 1080px in length. Its file size must not exceed 3MB. Exporting a PNG at 250 DPI resolution is usually a good way to generate a thumbnail. You are encouraged to use oxipng to reduce the thumbnail's file size. The thumbnail will automatically be excluded from the package files and must not be referenced anywhere in the package.

Template packages must specify at least one category in package.categories.

If you're submitting a template, please test that it works locally on your system. The recommended workflow for this is as follows:

  • Add a symlink from $XDG_DATA_HOME/typst/packages/preview to the preview folder of your fork of this repository (see the section on local packages).
  • Run typst init @preview/mypkg:version. Note that you must manually specify the version as the package is not yet in the index, so the latest version won't be detected automatically.
  • Compile the freshly instantiated template.

Third-party metadata

Third-party tools can add their own entry under the [tool] section to attach their Typst-specific configuration to the manifest.

[package]
# ...

[tool.mytool]
foo = "bar"

Published packages

This repository contains a collection of published packages. Due to its early and experimental nature, all packages in this repository are scoped in a preview namespace. A package that is stored in packages/preview/{name}/{version} in this repository will become available in Typst as #import "@preview/{name}:{version}". You must always specify the full package version.

You can use template packages to create new Typst projects with the CLI with the typst init command or the web application by clicking the Start from template button.

Submission guidelines

To submit a package, simply make a pull request with the package to this repository. There are a few requirements for getting a package published, which are detailed below:

  • Naming: Package names should not be the obvious or canonical name for a package with that functionality (e.g. slides is forbidden, but sliding or slitastic would be ok). We have this rule because users will find packages with these canonical names first, creating an unfair advantage for the package author who claimed that name. Names should not include the word "typst" (as it is redundant). If they contain multiple words, names should use kebab-case. Look at existing packages and PRs to get a feel for what's allowed and what's not.

    Additional guidance for template packages: It is often desirable for template names to feature the name of the organization or publication the template is intended for. However, it is still important to us to accommodate multiple templates for the same purpose. Hence, template names shall consist of a unique, non-descriptive part followed by a descriptive part. For example, a template package for the fictitious American Journal of Proceedings (AJP) could be called organized-ajp or eternal-ajp. Package names should be short and use the official entity abbreviation. Template authors are encouraged to add the full name of the affiliated entity as a keyword.

    The unamended entity name (e.g. ajp) is reserved for official template packages by their respective entities. Please make it clear in your PR if you are submitting an official package. We will then outline steps to authenticate you as a member of the affiliated organization.

    If you are an author of an original template not affiliated with any organization, only the standard package naming guidelines apply to you.

  • Functionality: Packages should conceivably be useful to other users and should expose their capabilities in a reasonable fashion.

  • Documentation: Packages must contain a README.md file documenting (at least briefly) what the package does and all definitions intended for usage by downstream users. Examples in the README should show how to use the package through an @preview import. If you have images in your README, you might want to check whether they also work in dark mode. Also consider running typos through your package before release.

  • Style: No specific code style is mandated, but two spaces of indent and kebab-case for variable and function names are recommended.

  • License: Packages must be licensed under the terms of an OSI-approved license. In addition to specifying the license in the TOML manifest, a package must either contain a LICENSE file or link to one in its README.md.

    Additional details for template packages: If you expect the package license's provisions to apply to the contents of the template directory (used to scaffold a project) after being modified through normal use, especially if it still meets the threshold of originality, you must ensure that users of your template can use and distribute the modified contents without restriction. In such cases, we recommend licensing at least the template directory under a license that requires neither attribution nor distribution of the license text. Such licenses include MIT-0 and Zero-Clause BSD. You can use an SPDX AND expression to selectively apply different licenses to parts of your package. In this case, the README or package files must make clear under which license they fall. If you explain the license distinction in the README file, you must not exclude it from the package.

  • Size: Packages should not contain large files or a large number of files. This will be judged on a case-by-case basis, but if it needs more than ten files, it should be well-motivated. To keep the package small and fast to download, please exclude images for the README or PDF files with documentation from the bundle. Alternatively, you can link to images hosted on a githubusercontent.com URL (just drag the image into an issue).

  • Security: Packages must not attempt to exploit the compiler or packaging implementation, in particular not to exfiltrate user data.

  • Safety: Names and package contents must be safe for work.

This list may be extended over time as improvements/issues to the process are discovered. Given a good reason, we reserve the right to reject any package submission.

When a package's PR has been merged and CI has completed, the package will be available for use. However, it can currently take a longer while until the package will be visible on Typst Universe. We'll reduce this delay in the future.

Once submitted, a package will not be changed or removed without good reason to prevent breakage for downstream consumers. By submitting a package, you agree that it is here to stay. If you discover a bug or issue, you can of course submit a new version of your package.

There is one exception: Minor fixes to the documentation or TOML metadata of a package are allowed if they can not affect the package in a way that might break downstream users.

Downloads

The Typst compiler downloads packages from the preview namespace on-demand. Once used, they are cached in {cache-dir}/typst/packages/preview where {cache-dir} is

  • $XDG_CACHE_HOME or ~/.cache on Linux
  • ~/Library/Caches on macOS
  • %LOCALAPPDATA% on Windows

Importing a cached package does not result in network access.

Local packages

Want to install a package locally on your system without publishing it or experiment with it before publishing? You can store packages in {data-dir}/typst/packages/{namespace}/{name}/{version} to make them available locally on your system. Here, {data-dir} is

  • $XDG_DATA_HOME or ~/.local/share on Linux
  • ~/Library/Application Support on macOS
  • %APPDATA% on Windows

Packages in the data directory have precedence over ones in the cache directory. While you can create arbitrary namespaces with folders, a good namespace for system-local packages is local:

  • Store a package in ~/.local/share/typst/packages/local/mypkg/1.0.0
  • Import from it with #import "@local/mypkg:1.0.0": *

Note that future iterations of Typst's package management may change/break this local setup.

License

The infrastructure around the package repository is licensed under the terms of the Apache-2.0 license. Packages in packages/ are licensed under their respective license.

packages's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

packages's Issues

content misalignment

Like seen in the user manual (first graphic) and also in my little code example (second graphic), the content, meaning p_1, p_2, ..., is colliding with the lines/graph. It would be great if it would go a little bit more away from the point it's referring to. Maybe there's an option that I'm missing but I think in that case the manual should change. To make clear what I mean the last image is what it should look like (I created the graph using Latex tikz)
grafik
grafik
grafik

Package overviews from website listing

As a typst packages user, I want the ability to quickly distinguish/preview packages within the official website listing so I don't have to scroll through all github homepage links to find how they differ.

Motivation

At this point, there are 3 stylized box libraries with 1 more on the way as a submitted PR. So, when you search for "box" in the package list, you get this (with boxaroo becoming a 4th entry if the PR is accepted):

image

From the summary information provided, it is impossible to see how they differ. IMHO, it is still within the website's scope to allow users to distinguish, at least at a high level, between similarly-described packages.

Suggestions

  1. Hovering over the package URL can display an image specified in the package's typst.toml, or default to the first readme image if unspecified:
Proof of concept

brave_htcQlvEiE2

  • Instead of an image, perhaps package authors can specify an overview.typ document or something that produces an svg, this way the source is in typst format and gives more display options to the website builders
  1. A dropdown arrow next to each package can show a preview of the package's readme. To prevent massive readme's from clobbering the screen, it can be a fixed-height preview with a "show more..." link to the full document.

  2. A sortable popularity metric next to each repo so that, between similar options, I can identify which is most likely to have the largest community interest. CTAN shows downloads/week and activity, is there a way to get this information from GitHub for typst/packages?

Disclaimer: These are of course just suggestions to get the ball rolling -- I realize the dev effort is nontrivial and there are many other items worth prioritizing instead. However, with the increasing number of packages being submitted, a single list starts to look intimidating without more tools at the user's disposal to narrow packages to what is most relevant for their use case.

Thanks for reading! I'm happy to close the issue and submit feedback elsewhere if there is a Discord channel/etc. more appropriate.

Template containing different flavors

Description

Hello,
I have written a package for my school (available here: https://github.com/SkytAsul/INSA-Typst-Template) and I would like to publish it here. However, this package comes with 3 different flavors: one for reports, one for blank documents and one for letters (and I plan on adding one for thesis).
All of those flavors come within one typ file, people simply have to choose between 3 functions to use in the show rule.
Shall I publish 3 separate templates here so they can be chosen from the template selection screen? I fear if everybody does that it will bloat the repository...

Stuck in loading loop

I'm not sure what I'm doing wrong, but I cannot get this to work.
If I put the following in my main.typ file, then the PDF preview loads, but then I can only make use of acronyms from within the main document, not within any other typst file.

#import "@preview/acrostiche:0.2.0": *

#init-acronyms((
  "NN": ("Neural Network",),
  "OS": ("Operating System",),
  "BIOS": ("Basic Input/Output System", "Basic Input/Output Systems"), 
)) 

If I put it at the beginning of a different typst file as well to make use of it, then the PDF preview gets stuck in a loading loop.
I've tried only adding the #init-acronyms((...)) part into the other documents, but then the compiler complains about no such function existing.

Not sure which typst version I'm using, but I'm using the web app (typst.app), so I'd guess it's the newest version?

Keywords for Packages

It would be nice to be able to supply a list of tags in typst.toml. Those tags could then be used
for searching for packages on the typst "Packages" page. Otherwise everything has to be included in the description, and it looks like the description is not updated for different versions on the Package page (I am not sure though, but entering "plot" into the filter bar should display "CeTZ" because it has the word "plotting" in its description).

lovelace does not display captions correctly

This code:

#import "@preview/lovelace:0.1.0": *
#show: setup-lovelace

#algorithm(caption: [The Euclidean algorithm], pseudocode(
  no-number,
  [*input:* integers $a$ and $b$],
  no-number,
  [*output:* greatest common divisor of $a$ and $b$],
  [*while* $a != b$ *do*],
  ind,
  [*if* $a > b$ *then*],
  ind,
  $a <- a - b$,
  ded,
  [*else*],
  ind,
  $b <- b - a$,
  ded,
  [*end*],
  ded,
  [*end*],
  [*return* $a$],
))

Displays:
image

Thanks for looking into this!

typo in units.scv

I realized that there is a typo in the file units.csv (in fact the colulomb unit doesn't work).
To fix it I think it is necessary to remove the character " as in the picture.
Thank you.
units.csv.pdf

colorful-boxes : Breakable boxes

Hi, at the moment colorful-boxes (previously typst-boxes) does not allow for breakable boxes, which can be somewhat annoying.
My solution is to download typst-boxes and modify the source code.

A simple question, how to create a PR for this package. Should I fork the whole typst/packages repository or should I fork the original repository ?

Thank you

Referencing a Table (tablex)

When trying to add the <reference-label> to the table and then @referencing it, I get the error "cannot reference sequence".

image

I've also tried putting everything into a #figure(), but that just leads to weird issues:
image
(there's also a completely empty page btwn the "Appendix" heading and the table, which is only there when wrapping it in #figure(). I've set the repeat-heading setting to true, which worked well in the non-#figure()-wrapped version.)

Suggestion: versions as subdirectories

I've worked with large monorepos that have thousands of entries in a single directory before (namely https://github.com/void-linux/void-packages), and it becomes unfun pretty quickly when trying to do blames or logs on parts of the tree. To prevent issues like this, I'd suggest moving to a layout like this:

packages/
    namespace/
        package_name/
            1.0.1/
            1.2.1/

this should help prevent things from getting out of control

Link to packages original github from the webpage

Description

So when I click the link of a package on the website, I want to ideally go to the repo as this may have examples, issues, links to other things like books which the release/summary thing on this repo for a package doesn't have. So either change the link to be github or add another button for the repo so users can navigate to the packages repo.

Allowing for a display name parameter in `typst.toml` for cleaner package listings in Typst Universe

Premise

Howdy, all!

While putting together the guided-resume-starter-cgc package, I tinkered around with the current name parameter in the TOML and discovered it must match the subdirectory for the package in @preview

The target audience for this package is less-technical folks — particularly university undergraduates who aren't necessarily Computer Science-oriented — and I anticipate that the vast majority of this audience will be going through the Typst Universe portal to initialize a new instance of this (or another) template.

With this audience in mind, I tried to use the name parameter as a "clean" name of the package, since guided-resume-starter-cgc is a bit verbose in the interest of avoiding collisions or using a "canonical" name. My hope was to use a more generic name when displaying the package to end users, such as "Resume Starter Guide" or something similar.

However, it appears that the name category is more akin to a package slug, and used to validate the package against its parent directory within @preview.

Recommendation

I understand the behavior of name as a validation check, but I do think it would be nice to have something akin to a display-name parameter (or something semantically equivalent) to declare a cleaner name. This parameter could then be used in GUI frontends for display purposes, such as in the packages listing of the Typst Universe portal.

While this may seem like a small detail, I've noticed that seemingly small things like kebab-case labels can be intimidating to a less-technical audience and may function as a barrier to Typst adoption. The kinder syntax of Typst versus my previous LaTeX template has been amazing, and I feel that accompanying this with a softer GUI label for packages would help encourage Typst adoption among this audience.

While this may not a usual practice among package managers (npm, brew, etc.), I feel that Typst's choice to encourage template creation via Universe makes this an appropriate addition to the package metadata schema.

Example

In the charged-ieee typst.toml, the current display name in Typst Universe is charged-ieee, matching the name parameter:

[package]
name = "charged-ieee"
version = "0.1.0"
compiler = "0.10.0"
entrypoint = "lib.typ"
...

My recommendation would be some additional parameter representing a clean name to be used in Typst Universe (or other GUIs):

[package]
name = "charged-ieee"
+ display-name = "Charged IEEE Template"
version = "0.1.0"
compiler = "0.10.0"
entrypoint = "lib.typ"
...

This label could then be used for the template's Typst Universe entry:

image

Caveats

In this case, the addition of a display-name parameter would ensure backwards compatibility. Current implementations of GUIs would continue to reference the slug contained at name, while updated GUIs could reference the display-name parameter for packages if they choose.

Weird edge case

The following code

#import "@preview/showybox:0.1.1": *
#show link: it => { text(blue, it.body) }
#showybox(
  title: [
    Title#footnote[
      https://google.com
    ]
  ],
)[
  https://github.com
]

renders correctly, however, while the Github link points to https://github.com the Google link (in the footnote) points to http://google.com instead of https://google.com.

If I remove #show link: it => { text(blue, it.body) } it points to https://google.com.

[feature request] overview bar at the top of each slide (Command)

I think it would be cool if you could add an overview bar which displays the chapters (first deph or as parameter or something) and highlights where you are in the presentation. It could use "..." if not all content fits and maybe optionally only show content that is ahead of you or the current slide is about. Maybe instead of using "..." an option to move the content in the next line could be helpful too for example for relatively short presentations.
The big plus compared to implementing it manually would be, that it would adapt dynamically if you change the chapter names and of course not having to implement it manually at all would be a plus point as well :)
This manually created example shows what it could look like:
grafik
`// Get Polylux from the official package repository
#import "@preview/polylux:0.3.1": *

// Make the paper dimensions fit for a presentation and the text larger
#set page(paper: "presentation-16-9")
#set text(size: 25pt)

// Use #polylux-slide to create a slide and style it using your favourite Typst functions
#polylux-slide[
#align(horizon + center)[
Very minimalist slides

A lazy author

July 23, 2023

]
]

#polylux-slide[

  1. theme 1 | 2. theme 2 | 3. theme 3
    = First theme

Some static text on this slide.
]
#polylux-slide[

  1. theme 1 | 2. theme 2 | 3. theme 3
    = First theme

more text for this theme
]
#polylux-slide[

  1. theme 1 | 2. theme 2 | 3. theme 3
    = second theme

Some static text on this slide.
]
#polylux-slide[

  1. theme 1 | 2. theme 2 | 3. theme 3
    = second theme

mor text for the second theme
]
#polylux-slide[

  1. theme 1 | 2. theme 2 | 3. theme 3
    = third theme

Some static text on this slide.
]
#polylux-slide[

  1. theme 1 | 2. theme 2 | 3. theme 3
    = third theme

more text for the last theme
]`

I think graph_plots seem to have issues with too large numbers in Visual Studio Code

I was trying to plot benchmarks and at a certain point Visual Studio Code shows at the preview window (opens at hovering over an variable) says "Loading...".

I've excluded that its just VS Code, it could far more than my reproduction code could.
Additionally pie_charts were not affected...
Anywhere beyond 10e+7 is the border. When this happens, VSCode starts eating ram like Chrome and starts intellisense again when there is no more left, thus stariting over again. I have to comment it out, reopen it (VSCode) and then it is fine.
I tried to reproduce and could make this:

working example:

#let usual_plot_2 = {

    let data_raw = (1, 2, 3, 4, 5)

    let data = data_raw.enumerate()

    let first_x = data.at(0).at(0)
    let last_x = data.last().at(0)

    let first_y = data.at(0).at(1)
    let last_y = data.last().at(1)


    let x_axis = axis(min: first_x, max: last_x + 1, location: "bottom")
    let y_axis = axis(min: first_y, max: last_y + 1, location: "left")

    let plot = plot(axes: (x_axis, y_axis), data: data)

    graph_plot(plot, (100%, 50%))
}

#usual_plot_2

too large:

#let usual_plot_3 = {

    let data_raw = (50000000000, 5555555555555555)

    let data = data_raw.enumerate()

    let first_x = data.at(0).at(0)
    let last_x = data.last().at(0)

    let first_y = data.at(0).at(1)
    let last_y = data.last().at(1)


    let x_axis = axis(min: first_x, max: last_x + 1, location: "bottom")
    let y_axis = axis(min: first_y, max: last_y + 1, location: "left")

    let plot = plot(axes: (x_axis, y_axis), data: data)

    graph_plot(plot, (100%, 50%))
}

// #usual_plot_3

VS Code:

#let data_raw = (5000, 10000, 20000, 40000, 80000, 160000, 320000, 640000, 1280000, 2560000, 5120000, 10240000, 20480000, 40960000, 81920000, 163840000, 327680000, 655360000, 1310720000, 2621440000, 5242880000, 10485760000, 20971520000, 41943040000, 83886080000, 167772160000, 335544320000, 671088640000, 1342177280000, 2684354560000, 5368709120000, 10737418240000, 21474836480000, 42949672960000, 85899345920000, 171798691840000, 343597383680000, 687194767360000, 1374389534720000, 2748779069440000, 5497558138880000, 10995116277760000, 21990232555520000, 43980465111040000, 87960930222080000, 175921860444160000, 351843720888320000, 703687441776640000, 1407374883553280000, 2814749767106560000, 5629499534213120000, 11258999068426200000, 22517998136852400000, 45035996273704800000, 90071992547409600000, 180143985094819000000, 360287970189639000000, 720575940379279000000, 1441151880758560000000, 2882303761517120000000, 5764607523034230000000, 11529215046068500000000, 23058430092136900000000, 46116860184273900000000, 92233720368547800000000, 184467440737096000000000, 368934881474192000000000, 737869762948384000000000, 1475739525896760000000000, 2951479051793520000000000, 5902958103587040000000000, 11805916207174000000000000, 23611832414348000000000000, 47223664828696000000000000, 94447329657392000000000000, 188894659314784000000000000, 377789318629568000000000000, 755578637259136000000000000, 1511157274518270000000000000, 3022314549036540000000000000)

#let data = data_raw.enumerate()

pie chart works fine:

// works
#let pie_chart_2 = {
    let data_raw = (10e+5, 10e+10, 10e+20)

    // let data_raw = (10e+3, 10e+4)

    let data = data_raw.enumerate()

    let plot = plot(data: data)

    pie_chart(plot, (50%, 50%))
}

#pie_chart_2

grafik

Glossarium not working with reference syntax -> cannot reference figure without numbering

Package: https://github.com/typst/packages/tree/main/packages/preview/glossarium/0.2.3

Trying to replicate the demo example:

#print-glossary((
  // minimal term
  (key: "kuleuven", short: "KU Leuven"),
  // a term with a long form
  (key: "unamur", short: "UNamur", long: "Université de Namur"),
  // no long form here
  (key: "kdecom", short: "KDE Community", desc:"An international team developing and distributing Open Source software."),
  // a full term with description containing markup
  (
    key: "oidc", 
    short: "OIDC", 
    long: "OpenID Connect", 
    desc: [OpenID is an open standard and decentralized authentication protocol promoted by the non-profit
     #link("https://en.wikipedia.org/wiki/OpenID#OpenID_Foundation")[OpenID Foundation].]),
))

// referencing the OIDC term using gls
#gls("oidc")
// displaying the long form forcibly
#gls("oidc", long: true)

// referencing the OIDC term using the reference syntax
@oidc

Usage as #gls("oidc") does work but usage as @oidcdoes produce the following error:

Error: cannot reference figure without numbering

I think it works under Typst 0.8.0 but not under Typst 0.9.0, so https://typst.app/docs/changelog/ might help, but I am not sure what the problem is.

How to: reference with @

I find it's a pleasing experience to write pseudo code with this package.
However, I find myself stuck with how to reference an algorithm using "@".I tried below to label my algorithm but it doesn't work with error: cannot reference sequence. I label my algorithm with @algo1as below:

#algo(
  title: [                    // note that title and parameters
    #set text(size: 15pt)     // can be content
    #emph(smallcaps("Curiosity driven exploration for molecule generation"))
  ],
  parameters: ([#math.italic("n")],),
  comment-prefix: [#sym.triangle.stroked.r ],
  comment-styles: (fill: rgb(100%, 0%, 0%)),
  indent-size: 15pt,
  indent-guides: 1pt + gray,
  row-gutter: 5pt,
  column-gutter: 5pt,
  inset: 5pt,
  stroke: 2pt + black,
  fill: none,
)[
"content of algorithm"
] <algo1>

I'm a beginner of typst, this is what I learned to achieve reference. I'm not sure if it also works with returns of #algo. Otherwise is there any other workaround to refer an algorithm as we do in Latex? I just need at least a basic way to refer my own algorithms.

Macro in column operator increase newlines

Description

I tried to apply a typst function math.upright to a certain cells, but after applying them, newlines are increasing leading the table. So I tested by change the function in the macro to math.sqrt and the following picture was captured.
Screen Shot 2567-01-20 at 23 21 40
Is this considered a bug? Or I used the macro feature improperly?

Validate package repo link exists

Description

Currently, packages can specify their repository in typst.toml, but this link is unvalidated (see Amelia-Mowers/typst-tabut#12 for an example)

It would be nice if one of the PR checks confirmed that URL-like fields in the config return valid status codes. As a bonus, if a link is broken, it would help maintainers notice this quickly if there was a visual indication on the packages webpage (e.g. a red slash through the link icon)

plotst having floating point issues (axis)

I would expect to see exact 0.1 - 1.0, or we have a way to round off these floating points?

#let dtree = (
  (2, 0.482),
  (4, 0.527),
  (6, 0.556),
  (8, 0.572),
  (10, 0.573),
  (12, 0.522),
  (14, 0.522),
  (16, 0.522),
  (18, 0.522),
  (20, 0.522)
)

#let x_axis = axis(min: 0, max: 22, step: 2, location: "bottom")
#let y_axis = axis(min: 0, max: 1, step:  0.1, location: "left")

#let pl_graph = plot(data: dtree, axes: (x_axis, y_axis))
#graph_plot(pl_graph, (100%, 25%), stroke: blue)
Screenshot 2023-11-23 at 9 50 33 AM

Large packages in the current git-based package system?

Description

The current centralized one git package system seems not adapted to large packages (typically fonts, icons), typically more than 10M.

  • Does it matter?
  • Should large package owner push their package nevertheless?
  • Is there any plan too change it?

Current maintainer of a hopefully short-lived out-of-tree package
Typst SVG Emoji

Description for cumcm-muban includes link to non-free font

Description

This may not be the correct venue for this, but I'm not sure what is. It's not really an issue with the package system, but it's also not (directly) an issue with the package.

On https://typst.app/universe/package/cumcm-muban there is a link to a zip-file at the bottom.

This zip file contains several fonts that aren't free (including Times New Roman). This was presumably done because the package author was told not to include them in the package, but linking to them is only marginally better. The correct way of dealing with this is to inform the user which fonts are needed, and it would then be up to them to get a hold of them.

Small typo in `acrostiche` package README

Trying to use the example in the README.md file of the acrostiche package, I noticed that there is currently a small typo (#init-acromyns(acronyms) instead of #init-acronyms(acronyms)) preventing it from working right away.

CC @Grisely

Suggestion: mini- and maximum supported Typst version for packages

Having a package break because you have the wrong Typst version could really suck. Then having to go through and painstakingly find the exact package version that supports your Typst version? Ugh.

This could be easily solvable if we let the packages themselves declare the range of Typst versions they support

[unify package] Set decimal separator manually

It should be possible to set the default decimal separator. I tried doing

#set _format-float(decsep: ",")

$ num("2.0") $

as I prefer to leave the numbers in code with dots (yet want it to show up as 2,0), but it throws a syntax error. Any way to set that in another way?

Proposal to rename this repository to something more identifiable

Proposal

I am proposing to rename this repository to something more identifiable, e.g. typkgs, instead of packages which is what we have right now. This is a very common pattern with repositories like crates.io, pypi, and npm

Motivation

  • This will give it a shorter and canonical name to refer to: typkgs vs. typst package repository
  • Open up possibilities for alternative package repositories. If alternative package repositories or packages without repositories were to be implemented. Renaming this will make it less ambiguous and reduce the potential confusion.
  • Third party tooling: This will make naming third party tools that interact specifically with this repository easier.

Drawbacks

  • This is a rename and people will need to adapt to the changes. The impact is minimal if we do this early, since GitHub will be able to handle the redirects.
  • Opportunity for bike shedding: Naming is hard, and people will have different opinions. This is not much of an issue for something generic like packages.

system wide local packages

Description

Please make typst look in /usr/share/ or something for packages aswell, not only user folder.

I am developing a typst package, that should be installable company-wide via pacman. We have an internal repository for sharing packages this way. I cannot install into user folders though.

Support picking latest version automatically

These would work like git tags; it could be very ergonomic to allow importing of @preview/somepkg:latest, etc.
It might be fair to limit it to just latest as a valid tag — being a special case and probably even handled automatically by typst itself — but keeping the form of allowed tags open allows for other interesting use cases in the future; perhaps some that we cannot fully consider at present day.

Show link to the repository in package list

I suggest two improvements for the package manager:

  • Add the repository link of each package in its readme file and/or in the searchable list of packages. Currently, you need to go to the typst.toml file and copy-paste the link into navigator, which is annoying when you want to see the full documentation and examples. Add also the link in the pull request would be great to navigate easily to the repo in order to discover it instead of going to files changed and look for typst.toml file.

  • Add a command to install package from an already downloaded zip. Automatic downloads can be blocked at work for security reasons (which is the case for me). I also reckon that add a link to download directly zip in the searchable list of packages might be a good idea. For the moment, if I want to download several packages, I have to go to each repo, check out the branch or tag to have the right version, donwload zip, copy-paste to the preview directory and then change the name with version to respect the tree structure.

acrostiche in a show rule

it would be neat if you could define a show rule instead of calling #accr functions.

show rules cannot support the following syntax yet but let it be food for thoughts :

show: x if x in accronym_list.map(get_short_version) => {
          if already been used {
                     use short version
          } else { use long version }
}

Syntree broken since Typst 0.7

First of all: great idea for a package!

I tried the example in the ReadMe and it compiled, but it produced the output below.
Unbenannt

I am using the VsCode plugin connected to the Typst-LSP. Is this problem related to that or am I missing something else?

Minimum Typst Version key

I think, it would be useful to have a way of specifying the minimum typst version for a package. Many packages or at least newer releases might only work on the more recent Typst versions and fail without giving any helpful error messages with an old compiler.

I can think of two ways to achieve this:

  • Typst could take the responsibility of checking the version when importing packages and another optional field is added to typst.toml. The question would be how Typst gets the version information (definitely possible but likely some work).
  • A much simpler solution would be Typst providing a function to obtain the current version (and possible a helper for determining if the version is less than some specified one) and the packages can then emit a reasonable error message if the version is not supported.

Just some thoughts. This is not too urgent but will come up sooner or later :)

circular arrows for self-pointing

Issue

I don't quite know how to make a circular arrow, in that it tracks the circumference of a circle, starts at a node A and ends at node A with the specified head type. Here's my code and I'll add some images.

Code

#import "@preview/cetz:0.1.2"
#import "@preview/fletcher:0.2.0": *


// attempt at an expanded central dogma of biology
#fletcher.diagram(cell-size: 8mm, {
  // dg is for central dogma, i.e. the original three steps
  //   of replication, transcription, and translation
  let (dna, rna, protein) = ((0,1), (2,1), (4,1))
  node(dna, `DNA`, )
  node(rna, `RNA`)
  node(protein, `PROTEIN`)
  edge(dna, dna, `Replication`, "->", bend: 0deg)      // <--- the part i'm having issues with
  edge(dna, rna, `Transcription`, "->", bend: 10deg)
  edge(rna, dna, `Transcription`, "->", bend: 10deg)
  edge(rna, protein, `Translation`, "->")
})

Output (screenshot of relevant bits)

Without trying to make a circular arrow (i.e. line of interest commented out)

image

Trying to make a circular arrow

image

Reference image for what I'd like to do

image
PS

Hey, thanks for the package, i tried working on one a while back for cetz (when it was called something else) but never figured out how to make it work. Tried to think of how to implement a simple pathing algo (djikstra's) for a timeline maker thing but left after I learned that there are these things things called ASTs

UDP Protocol typo

There is a typo in the UDP Packet definition.

"Destinatino Port"

edit: closed as it's only related to bytefield package

Add support for MSB first bit order

Currently, these diagrams show bits from 0 to N, but many diagrams of byte fields start with the MSB (N down to 0). Could support for this be added?

glossarium breaks if page numbering is not set

The "glossarium" package's example works because it does #set page(numbering: "1", paper: "a5").
However, if you don't have page numbering set, e.g., because you print it manually in a custom footer, it will break in this line

)[#numbering(x.page-numbering(), ..counter(page).at(x))],

Unfortunately I am rather new to typst and don't yet have an idea how to fix it except for globally setting the page numbering as in the example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.