{"id":18468382,"url":"https://github.com/flaribbit/numbly","last_synced_at":"2026-01-22T05:33:16.076Z","repository":{"id":260780768,"uuid":"820303173","full_name":"flaribbit/numbly","owner":"flaribbit","description":"A package that helps you to specify different numbering formats for different levels of headings.","archived":false,"fork":false,"pushed_at":"2024-11-02T14:23:51.000Z","size":7,"stargazers_count":19,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T19:15:43.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/flaribbit.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,"zenodo":null}},"created_at":"2024-06-26T07:52:58.000Z","updated_at":"2025-04-23T01:00:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd7b5e08-a340-490c-a4c4-968cb691b71c","html_url":"https://github.com/flaribbit/numbly","commit_stats":null,"previous_names":["flaribbit/numbly"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flaribbit/numbly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Fnumbly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Fnumbly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Fnumbly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Fnumbly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flaribbit","download_url":"https://codeload.github.com/flaribbit/numbly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Fnumbly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28656281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-06T10:06:14.721Z","updated_at":"2026-01-22T05:33:16.071Z","avatar_url":"https://github.com/flaribbit.png","language":"Typst","funding_links":[],"categories":["Typst"],"sub_categories":[],"readme":"# numbly\n\nA package that helps you to specify different numbering formats for different levels of headings.\n\n## Usage example\n\nSuppose you want to specify the following numbering format for your document:\n\n- Appendix A. Guide\n  - A.1. Installation\n    - Step 1. Download\n    - Step 2. Install\n  - A.2. Usage\n\nYou might use `if` to achieve this:\n\n```typst\n#set heading(numbering: (..nums) =\u003e {\n  nums = nums.pos()\n  if nums.len() == 1 {\n    return \"Appendix \" + numbering(\"A.\", ..nums)\n  } else if nums.len() == 2 {\n    return numbering(\"A.1.\", ..nums)\n  } else {\n    return \"Step \" + numbering(\"1.\", nums.last())\n  }\n})\n\n= Guide\n== Installation\n=== Download\n=== Install\n== Usage\n```\n\nBut with `numbly`, you can do this more easily:\n\n```typst\n#import \"@preview/numbly:0.1.0\": numbly\n#set heading(numbering: numbly(\n  \"Appendix {1:A}.\", // use {level:format} to specify the format\n  \"{1:A}.{2}.\", // if format is not specified, arabic numbers will be used\n  \"Step {3}.\", // here, we only want the 3rd level\n))\n\n= Guide\n== Installation\n=== Download\n=== Install\n== Usage\n```\n\n![image](https://github.com/user-attachments/assets/27e81a8e-e154-43b8-bed7-d3cd8ef4b2a4)\n\nHere is another example:\n```typst\n#import \"@preview/numbly:0.1.0\": numbly\n#set heading(numbering: numbly(\n  \"Part {1:I}:\",\n  \"{2}.\",\n  \"{2}.{3}.\",\n))\n#show heading.where(level: 1): set align(center)\n\n= Getting Started with Python\n== Introduction to Python\n=== What is Python?\n=== Why Choose Python?\n=== Python 2 vs. Python 3\n== Setting Up Your Environment\n=== Installing Python\n=== Setting up an Integrated Development Environment (IDE)\n= Core Concepts\n== Control Structures\n== Functions\n```\n\n![image](https://github.com/user-attachments/assets/a80432d1-e679-4354-a2ac-2eb2c5c8edd0)\n\n## General explanation\n\nIn general the function `numbly` takes an arbitrary number of string arguments. \nThe first argument specifies the formating of the numbering of the first level headers, the second for the second level headers and so on. \nIf one wants to access the number of the $n$th level header, one can use `{n:f}`, where `f` is a counting symbol, which states how the number is represented (e.g. `1` stands for arabic numbers, which is the default, `I` for roman numbers from capital letters and so on). A list of all possible counting symbols can be found in the typst documentation of numbering (https://typst.app/docs/reference/model/numbering/).\n\n## Bonus\n\nAlthough the following scenario was not initially considered, we were surprised to find that this library can also be used to number lists and page numbers!\n\n```typst\n#import \"@preview/numbly:0.1.0\": numbly\n#set enum(full: true, numbering: numbly(\n  \"{1:A}.\",\n  \"{2}.\",\n  \"{3})\",\n))\n\n+ Item 1\n  + Item 2\n    + Item 3\n    + Item 4\n+ Item 5\n  + Item 6\n  + Item 7\n```\n\n![image](https://github.com/user-attachments/assets/03ee2c54-3429-4dba-a832-984be7ad32b4)\n\n```typst\n#import \"@preview/numbly:0.1.0\": numbly\n#set text(lang: \"zh\")\n#set page(numbering: numbly(\"{1}\", \"第{1}页/共{2}页\"))\n\n#outline()\n= 你说得对\n#pagebreak()\n= 但是原神\n```\n\n![image](https://github.com/user-attachments/assets/1b1cf577-b5fe-4a74-a0b6-6d3eb7231a7a)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaribbit%2Fnumbly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflaribbit%2Fnumbly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaribbit%2Fnumbly/lists"}