{"id":21524149,"url":"https://github.com/epicericee/typst-quick-maths","last_synced_at":"2026-01-30T10:12:32.055Z","repository":{"id":253468156,"uuid":"824539806","full_name":"EpicEricEE/typst-quick-maths","owner":"EpicEricEE","description":"A Typst package for creating custom shorthands for math equations.","archived":false,"fork":false,"pushed_at":"2025-02-19T20:12:04.000Z","size":55,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-19T21:23:50.421Z","etag":null,"topics":["typst","typst-package","typst-plugin"],"latest_commit_sha":null,"homepage":"","language":"Typst","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EpicEricEE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-05T10:51:57.000Z","updated_at":"2025-02-19T20:12:08.000Z","dependencies_parsed_at":"2024-08-16T23:22:05.994Z","dependency_job_id":"4893ef8f-a4fb-4a97-b7e7-fc299901d4b2","html_url":"https://github.com/EpicEricEE/typst-quick-maths","commit_stats":null,"previous_names":["epicericee/typst-quick-maths"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpicEricEE%2Ftypst-quick-maths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpicEricEE%2Ftypst-quick-maths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpicEricEE%2Ftypst-quick-maths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpicEricEE%2Ftypst-quick-maths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EpicEricEE","download_url":"https://codeload.github.com/EpicEricEE/typst-quick-maths/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244082548,"owners_count":20395294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["typst","typst-package","typst-plugin"],"created_at":"2024-11-24T01:21:09.404Z","updated_at":"2026-01-30T10:12:31.987Z","avatar_url":"https://github.com/EpicEricEE.png","language":"Typst","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quick-maths\r\n\r\nA package for creating custom shorthands for math equations.\r\n\r\n## Usage\r\n\r\nThe package comes with a single template function `shorthands` that takes one or more tuples of the form `(shorthand, replacement)`, where `shorthand` can be a string or content.\r\n\r\nThere are some small quality of life features for interaction of shorthands with fractions and attachments:\r\n\r\n- If the right-most symbol of a shorthand has any attachments, they are moved to the shorthand's replacement.\r\n- If a shorthand ends in the numerator of a fraction, the whole replacement is placed in the numerator.\r\n- If a shorthand starts in the denominator of a fraction, the whole replacement is placed in the denominator.\r\n\r\nAs the implementation of these features is quite hacky, you may encounter some edge cases, where the use of explicit parentheses hopefully saves you.\r\n\r\n## Notes\r\n\r\n- Shorthands are parsed in the order they are given, so if you have a shorthand that is a prefix of another shorthand, you should put the longer shorthand first.\r\n\r\n- The content of an equation is traversed from left to right, so the left-most matching shorthand will be replaced first.\r\n\r\n- Shorthands consisting of only a single character or element may be applied using show rules, so that they can affect non-sequence elements. This may lead to different behavior than multi-character shorthands.\r\n\r\n- If the replacement of a shorthand contains a shorthand itself, there are no protections against infinite recursion or overflows.\r\n\r\n## Example\r\n\r\n```typ\r\n#import \"@preview/quick-maths:0.2.1\": shorthands\r\n\r\n#show: shorthands.with(\r\n  ($+-$, $plus.minus$),\r\n  ($|-$, math.tack),\r\n  ($\u003c=$, math.arrow.l.double) // Replaces '≤'\r\n)\r\n\r\n$ x^2 = 9 quad \u003c==\u003e quad x = +-3 $\r\n$ A or B |- A $\r\n$ x \u003c= y $\r\n```\r\n\r\n![Result of example code.](./assets/example.svg)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepicericee%2Ftypst-quick-maths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepicericee%2Ftypst-quick-maths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepicericee%2Ftypst-quick-maths/lists"}