{"id":13523501,"url":"https://github.com/LaPreprint/typst","last_synced_at":"2025-04-01T00:31:59.716Z","repository":{"id":189416743,"uuid":"680638824","full_name":"LaPreprint/typst","owner":"LaPreprint","description":"Easily create beautiful preprints in Typst","archived":false,"fork":false,"pushed_at":"2024-04-06T23:52:49.000Z","size":7697,"stargazers_count":196,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-06-11T17:29:07.774Z","etag":null,"topics":["typst","typst-template"],"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/LaPreprint.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":"2023-08-19T22:36:44.000Z","updated_at":"2024-06-07T21:49:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5c75398-2c06-4f76-8337-85fa87cf3fb3","html_url":"https://github.com/LaPreprint/typst","commit_stats":null,"previous_names":["rowanc1/lapreprint","lapreprint/typst"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaPreprint%2Ftypst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaPreprint%2Ftypst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaPreprint%2Ftypst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaPreprint%2Ftypst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LaPreprint","download_url":"https://codeload.github.com/LaPreprint/typst/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222688174,"owners_count":17023297,"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-template"],"created_at":"2024-08-01T06:01:00.648Z","updated_at":"2024-11-02T07:31:46.938Z","avatar_url":"https://github.com/LaPreprint.png","language":"Typst","funding_links":[],"categories":["Templates \u0026 Libraries","Typst"],"sub_categories":["General"],"readme":"\u003ch1 align=\"center\"\u003eLaPreprint for Typst\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/rowanc1/LaPreprint/blob/main/LICENSE\"\u003e\u003cimg alt=\"MIT License\" src=\"https://img.shields.io/github/license/rowanc1/lapreprint?style=flat-square\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/rowanc1/lapreprint\"\u003e\u003cimg alt=\"Stars\" src=\"https://img.shields.io/github/stars/rowanc1/lapreprint?style=social\"\u003e\u003c/a\u003e\n\u003ca href=\"https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Frowanc1%2FLaPreprint\u0026via=rowancockett\u0026text=Checkout%20the%20LaPreprint%20template%20for%20Typst\"\u003e\u003cimg alt=\"Twitter\" src=\"https://img.shields.io/twitter/follow/rowancockett\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eEasily create beautiful preprints in Typst\u003c/b\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"75%\" src=\"https://raw.githubusercontent.com/rowanc1/LaPreprint/68f5ccbf1e1e26819149bcea1d547dfdfc5ceecd/example/files/screenshot.png\"\u003e\n\u003c/p\u003e\n\n```typst\n#import \"lapreprint.typ\": template\n\n#show: template.with(\n  title: \"A beautiful preprint template\"\n)\n```\n\n# Features\n\nWith simple options you can enable/disable:\n\n- color schemes of blue, red, purple\n- author, ORCID, and affiliation support\n- branding and logo support\n- left margin with custom headings\n- date accepted, published \u0026 submitted\n- customizable font choices\n- running title, affiliation\n- multiple abstracts, e.g. plain language summary or english/french!\n- keywords, page count, nice headings\n- easily customize APA or IEEE citation style\n- Optional: full width after first page\n\n# Quick start\n\nThe preprint template uses Typst (not LaTeX[^latex]) for typesetting, see [typst docs](https://typst.app/docs).\n\n[^latex]: If you are looking for LaPreprint for LaTeX, please see: https://github.com/roaldarbol/LaPreprint\n\nCopy [`lapreprint.typ`](./lapreprint.typ) to your own folder that you are working in, you only need the single `lapreprint.typ` file:\n\n```typst\n#import \"lapreprint.typ\": template\n```\n\nTake a look at the examples in the [GitHub repository](https://github.com/rowanc1/LaPreprint), for example, [this file](https://github.com/rowanc1/lapreprint/blob/main/examples/pixels/main.typ#L5), the basics are to use the template with a `#show` command:\n\n```typst\n#show: template.with(\n  title: \"A beautiful preprint template\"\n  // ... all sorts of other options that are explained below!\n)\n```\n\n## Logos and Branding\n\nThe theme of the document can be set to a specific color, which changes the headers and links. The default `theme` is blue, however, the following examples use:\n\n```typst\ntheme: red.darken(50%),\n```\n\nYou can also supply a logo, which is either an image file location or content, allowing you to add additional information about the journal or lab-group to the top-right of the document. You can also set the `paper-size`, `heading-numbering` and `font-face`. The default font-face used is Noto Sans, which you may need to [download](https://fonts.google.com/noto/specimen/Noto+Sans).\n\n```typst\nlogo: \"my-logo.png\",\ntheme: purple.darken(20%),\npaper-size: \"us-letter\",\nheading-numbering: \"1.a.i\",\nfont-face: \"Noto Sans\",\n```\n\n![image](https://github.com/rowanc1/LaPreprint/assets/913249/ea6ce83b-8694-4636-8317-e49b3231352f)\n\n## Title and Subtitle\n\nYou can have both a title and a subtitle:\n\n```typst\ntitle: \"Pixels and their Neighbours\",\nsubtitle: \"A Tutorial on Finite Volume\",\n```\n\nWill become:\n\n![image](https://github.com/rowanc1/LaPreprint/assets/913249/534aba93-5284-4daa-baeb-38a07f0bdf5c)\n\n## Authors and Affiliations\n\nYou can add both author and affiliations lists, each author should have a `name`, and can optionally add `orcid`, `email`, and `affiliations`. The affiliations are just content that is put in superscript, e.g. `\"1,2\"`, have corresponding identifiers in the top level `affiliations` list, which requires both an `id` and a `name`. If you wish to include any additional information in the affiliation (e.g. an address, department, etc.), it is content and can have whatever you want in it.\n\n```typst\nauthors: (\n  (\n    name: \"Rowan Cockett\",\n    orcid: \"0000-0002-7859-8394\",\n    email: \"rowan@curvenote.com\",\n    affiliations: \"1,2\"\n  ),\n  // Add other authors here...\n),\naffiliations: (\n   (id: \"1\", name: \"University of British Columbia\"),\n   (id: \"2\", name: \"Curvenote Inc.\"),\n  ),\n```\n\n![image](https://github.com/rowanc1/LaPreprint/assets/913249/2787467a-e63b-4d61-a2db-339ae141fd7c)\n\nNote that the orcid and email icons are actually aligned to the text. Details, details!\n\nFor other information that you wish to affiliate with a specific author, you can use the `affiliations` field with any identifier you like (e.g. `†`) and then use the margin content or affiliations fields on the preprint to explain what it means.\n\n## Abstract and Keywords\n\nYou can include one or more abstracts as well as keywords. For a simple `abstract` the default title used is \"Abstract\" and you can include it with:\n\n```typst\nabstract: lorem(100),\nkeywords: (\"Finite Volume\", \"Tutorial\", \"Reproducible Research\"),\n```\n\nTo include one or more specific abstracts, for example, different languages or a \"Plain Language Summary\", provide a list, with `title` and `content` in a dictionary:\n\n```typst\nabstract: (\n  (title: \"Abstract\", content: lorem(100)),\n  (title: \"Plain Language Summary\", content: lorem(25)),\n),\n```\n\n![image](https://github.com/rowanc1/LaPreprint/assets/913249/63727565-3c56-40a1-9548-5d4039973f8a)\n\n## Margin content\n\nThe content on the first page is customizable. The first content is the `kind`, for example, \"Original Research\", \"Review Article\", \"Retrospective\" etc. And then the `date`, which is by default the date you compiled the document.\n\n```typst\nkind: \"Notebook Tutorial\",\ndate: datetime(year: 2023, month: 08, day: 21),\n```\n\nYou can also set `date` to be a dictionary or list of dictionaries with `title` and `date` as the two required keys. The first date will be bolded as well as used in the document metadata and auto `short-citation`.\n\n```typst\nkind: \"Notebook Tutorial\",\ndate: (\n  (title: \"Published\", date: datetime(year: 2023, month: 08, day: 21)),\n  (title: \"Accepted\", date: datetime(year: 2022, month: 12, day: 10)),\n  (title: \"Submitted\", date: datetime(year: 2022, month: 12, day: 10)),\n),\n```\n\n![image](https://github.com/rowanc1/LaPreprint/assets/913249/19c9ebda-db98-4ac5-919c-cde339de64b9)\n\nThe rest of the margin content can be set with `margin` property, which takes a `title` and `content`, content is required, however the title is optional.\n\n```typst\nmargin: (\n  (\n    title: \"Correspondence to\",\n    content: [\n      Rowan Cockett\\\n      #link(\"mailto:rowan@curvenote.com\")[rowan\\@curvenote.com]\n    ],\n  ),\n  // ... other properties\n)\n```\n\nYou can use the margin property for things like funding, data availability statements, explicit correspondence requests, key points, conflict of interest statements, etc.\n\n![image](https://github.com/rowanc1/LaPreprint/assets/913249/61c264b1-509b-4082-87e5-1e6aa7a4673c)\n\n### Setting the Margin\n\nThe first page has a left hand margin of 25%, if you do nothing this will continue for your whole document. To override this, you can reset the margin after the first page by placing `#set page(margin: auto)` in a place where you want the page break between the first and second pages[^margin].\n\nIf you opt for resetting to a full-width margin, you will want to not supply a `bibliography-file` to the template, and instead do this in your content, this is because the template will revert to the first-page margin as well as inserting a page break[^bug]. See the section on bibliography below.\n\n[^margin]: If you know a better way of doing this to automate it in the template, please open an issue or pull-request!!\n[^bug]: This seems like a bug to me in typst, but maybe is by design?\n\n## Headers and Footers\n\nYou can control the headers and footer by providing the following information:\n\n```typst\nopen-access: true,\ndoi: \"10.1190/tle35080703.1\",\nvenue: [ar#text(fill: red.darken(20%))[X]iv],\nshort-title: \"Finite Volume Tutorial\",\nshort-citation: auto,\ndate: datetime.today()\n```\n\nThe first page will show an open-access statement and the `doi` if available. For DOIs, only include the actual identifier, not the URL portions:\n\n![image](https://github.com/rowanc1/LaPreprint/assets/913249/99da9ef4-fa02-4284-ac46-d3b8d2f48752)\n\nSubsequent pages will show the `short-title` and `short-citation`. If the citation is `auto` (the default) it will be created in APA formatting using the paper authors.\n\n![image](https://github.com/rowanc1/LaPreprint/assets/913249/72f2a52a-717c-4fbd-9cd3-1eaa053d7c7f)\n\nThe footers show the `venue` (e.g. the journal or preprint repository) the `date` (which is by default `today()`) as well as the page count.\n\n![image](https://github.com/rowanc1/LaPreprint/assets/913249/c2c52102-3bb7-4811-971c-da8b1701169a)\n\n## Bibliography\n\nThe bibliography is only included in the theme if you supply the `bibliography-file` and an optional `bibliography-style`. The default `bibliography-style` is `\"apa\"`, you can override this if you like, for example, to `\"ieee\"`.\n\nIf you have opted for full-page margins or have an appendix, you may want to place the bibliography yourself as including in the template will default back to the same margin as the first page. You can also handle the bibliography yourself with:\n\n```typst\n#{\n  show bibliography: set text(8pt)\n  bibliography(\"main.bib\", title: text(10pt, \"References\"), style: \"apa\")\n}\n```\n\n# Acknowledgements\n\nThe Typst LaPreprint template (and this Readme!) is inspired by [@roaldarbol LaTeX template](https://github.com/roaldarbol/LaPreprint), which is in the style of eLife and PLoS. Portions of the template were based on the example IEEE template in Typst.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLaPreprint%2Ftypst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLaPreprint%2Ftypst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLaPreprint%2Ftypst/lists"}