{"id":24619297,"url":"https://github.com/continuous-foundation/pubmatter","last_synced_at":"2025-03-18T22:40:45.843Z","repository":{"id":219368453,"uuid":"748880051","full_name":"continuous-foundation/pubmatter","owner":"continuous-foundation","description":"A typst library for parsing and showing publication frontmatter","archived":false,"fork":false,"pushed_at":"2024-11-29T23:07:43.000Z","size":7117,"stargazers_count":9,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T00:18:53.812Z","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/continuous-foundation.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-01-26T23:57:03.000Z","updated_at":"2024-11-29T23:07:47.000Z","dependencies_parsed_at":"2024-02-08T16:58:04.540Z","dependency_job_id":"d241fe06-fe18-436f-a07d-bd6d32b919bb","html_url":"https://github.com/continuous-foundation/pubmatter","commit_stats":null,"previous_names":["curvenote/pubmatter","continuous-foundation/pubmatter"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continuous-foundation%2Fpubmatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continuous-foundation%2Fpubmatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continuous-foundation%2Fpubmatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continuous-foundation%2Fpubmatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/continuous-foundation","download_url":"https://codeload.github.com/continuous-foundation/pubmatter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244320325,"owners_count":20434090,"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":[],"created_at":"2025-01-25T00:19:00.333Z","updated_at":"2025-03-18T22:40:45.837Z","avatar_url":"https://github.com/continuous-foundation.png","language":"Typst","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pubmatter\n\n_Beautiful scientific documents with structured metadata for publishers_\n\n[![Documentation](https://img.shields.io/badge/typst-docs-orange.svg)](https://github.com/continuous-foundation/pubmatter/blob/main/docs.pdf)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/continuous-foundation/pubmatter/blob/main/LICENSE)\n\nPubmatter is a typst library for parsing, normalizing and showing scientific publication frontmatter.\n\nUtilities for loading, normalizing and working with authors, affiliations, abstracts, keywords and other frontmatter information common in scientific publications. Our goal is to introduce standardized ways of working with this content to expose metadata to scientific publishers who are interested in using typst in a standardized way. The specification for this `pubmatter` is based on [MyST Markdown](https://mystmd.org) and [Quarto](https://quarto.org), and can load their YAML files directly.\n\n## Examples\n\nPubmatter was used to create these documents, for loading the authors in a standardized way and creating the common elements (authors, affiliations, ORCIDs, DOIs, Open Access Links, copyright statements, etc.)\n\n![](https://github.com/continuous-foundation/pubmatter/blob/main/images/lapreprint.png?raw=true)\n\n![](https://github.com/continuous-foundation/pubmatter/blob/main/images/scipy.png?raw=true)\n\n![](https://github.com/continuous-foundation/pubmatter/blob/main/images/agrogeo.png?raw=true)\n\n## Documentation\n\nThe full documentation can be found in [docs.pdf](https://github.com/continuous-foundation/pubmatter/blob/main/docs.pdf). To use `pubmatter` import it:\n\n```typst\n#import \"@preview/pubmatter:0.1.0\"\n```\n\nThe docs also use `pubmatter`, in a simplified way, you can see the [docs.typ](https://github.com/continuous-foundation/pubmatter/blob/main/docs.typ) to see a simple example of using various components to create a new document. Here is a preview of the docs:\n\n[![](https://github.com/continuous-foundation/pubmatter/blob/main/images/pubmatter.png?raw=true)](https://github.com/continuous-foundation/pubmatter/blob/main/docs.pdf)\n\n### Loading Frontmatter\n\nThe frontmatter can contain all information for an article, including title, authors, affiliations, abstracts and keywords. These are then normalized into a standardized format that can be used with a number of `show` functions like `show-authors`. For example, we might have a YAML file that looks like this:\n\n```yaml\nauthor: Rowan Cockett\ndate: 2024/01/26\n```\n\nYou can load that file with `yaml`, and pass it to the `load` function:\n\n```typst\n#let fm = pubmatter.load(yaml(\"pubmatter.yml\"))\n```\n\nThis will give you a normalized data-structure that can be used with the `show` functions for showing various parts of a document.\n\nYou can also use a `dictionary` directly:\n\n```typst\n#let fm = pubmatter.load((\n  author: (\n    (\n      name: \"Rowan Cockett\",\n      email: \"rowan@curvenote.com\",\n      orcid: \"0000-0002-7859-8394\",\n      affiliations: \"Curvenote Inc.\",\n    ),\n  ),\n  date: datetime(year: 2024, month: 01, day: 26),\n  doi: \"10.1190/tle35080703.1\",\n))\n#pubmatter.show-author-block(fm)\n```\n\n![](https://github.com/continuous-foundation/pubmatter/blob/main/images/author-block.png?raw=true)\n\n### Theming\n\nThe theme including color and font choice can be set using the `THEME` state.\nFor example, this document has the following theme set:\n\n```typst\n#let theme = (color: red.darken(20%), font: \"Noto Sans\")\n#state(\"THEME\").update(theme)\n#set page(header: pubmatter.show-page-header(fm), footer: pubmatter.show-page-footer(fm))\n```\n\nNote that for the `header` the theme must be passed in directly. This will hopefully become easier in the future, however, there is a current bug that removes the page header/footer if you set this above the `set page`. See [https://github.com/typst/typst/issues/2987](#2987).\n\nThe `font` option only corresponds to the frontmatter content (abstracts, title, header/footer etc.) allowing the body of your document to have a different font choice.\n\n### Normalized Frontmatter Object\n\nThe frontmatter object has the following normalized structure:\n\n```yaml\ntitle: content\nsubtitle: content\nshort-title: string # alias: running-title, running-head\n# Authors Array\n# simple string provided for author is turned into ((name: string),)\nauthors: # alias: author\n  - name: string\n    url: string # alias: website, homepage\n    email: string\n    phone: string\n    fax: string\n    orcid: string # alias: ORCID\n    note: string\n    corresponding: boolean # default: `true` when email set\n    equal-contributor: boolean # alias: equalContributor, equal_contributor\n    deceased: boolean\n    roles: string[] # must be a contributor role\n    affiliations: # alias: affiliation\n      - id: string\n        index: number\n# Affiliations Array\naffiliations: # alias: affiliation\n  - string # simple string is turned into (name: string)\n  - id: string\n    index: number\n    name: string\n    institution: string # use either name or institution\n# Other publication metadata\nopen-access: boolean\nlicense: # Can be set with a SPDX ID for creative commons\n  id: string\n  url: string\n  name: string\ndoi: string # must be only the ID, not the full URL\ndate: datetime # validates from 'YYYY-MM-DD' if a string\ncitation: content\n# Abstracts Array\n# content is turned into ((title: \"Abstract\", content: string),)\nabstracts: # alias: abstract\n  - title: content\n    content: content\n```\n\nNote that you will usually write the affiliations directly in line, in the following example, we can see that the output is a normalized affiliation object that is linked by the `id` of the affiliation (just the name if it is a string!).\n\n```typst\n#let fm = pubmatter.load((\n  authors: (\n    (\n      name: \"Rowan Cockett\",\n      affiliations: \"Curvenote Inc.\",\n    ),\n    (\n      name: \"Steve Purves\",\n      affiliations: (\"Project Jupyter\", \"Curvenote Inc.\"),\n    ),\n  ),\n))\n#raw(lang:\"yaml\", yaml.encode(fm))\n```\n\n![](https://github.com/continuous-foundation/pubmatter/blob/main/images/normalized.png?raw=true)\n\n### Full List of Functions\n\n- `load()` - Load a raw frontmatter object\n- `doi-link()` - Create a DOI link\n- `email-link()` - Create a mailto link with an email icon\n- `github-link()` - Create a link to a GitHub profile with the GitHub icon\n- `open-access-link()` - Create a link to Wikipedia with an OpenAccess icon\n- `orcid-link()` - Create a ORCID link with an ORCID logo\n- `show-abstract-block()` - Show abstract-block including all abstracts and keywords\n- `show-abstracts()` - Show all abstracts (e.g. abstract, plain language summary)\n- `show-affiliations()` - Show affiliations\n- `show-author-block()` - Show author block, including author, icon links (e.g. ORCID, email, etc.) and affiliations\n- `show-authors()` - Show authors\n- `show-citation()` - Create a short citation in APA format, e.g. Cockett _et al._, 2023\n- `show-copyright()` - Show copyright statement based on license\n- `show-keywords()` - Show keywords as a list\n- `show-license-badge()` - Show the license badges\n- `show-page-footer()` - Show the venue, date and page numbers\n- `show-page-header()` - Show an open-access badge and the DOI and then the running-title and citation\n- `show-spaced-content()`\n- `show-title()` - Show title and subtitle\n- `show-title-block()` - Show title, authors and affiliations\n\n## Contributing\n\nTo help with standardization of metadata or improve the show-functions please contribute to this package: \\\nhttps://github.com/continuous-foundation/pubmatter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontinuous-foundation%2Fpubmatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontinuous-foundation%2Fpubmatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontinuous-foundation%2Fpubmatter/lists"}