\\n\\n
or similar, your CSL file now instead needs to print a decorated version of the paper\'s citation-key (= Bibtex key):
\\n<text variable=\\"citation-key\\" prefix=\\" !!BIBENTRY!\\" suffix=\\"!!. \\" />\\n
\\nYou can have more prefix before and suffix after the !!BIBENTRY!
and !!
, as in the example, but these magic symbols need to be there so Blinky can find the places in the document where the hyperlinked title needs to be inserted.
You can check the example CSL file to see what this looks like in practice; compare to the unmodified original.
\\nThe current mechanism in Blinky is somewhat heavy-handed: a Typst plugin uses the biblatex crate to parse the Bibtex file (independently of the normal operations of the bibliography
command), and then all occurrences of the magic symbol in the Typst bibliography are replaced by the hyperlinked titles.
It would be great to replace this mechanism by something simpler, but it is actually remarkably tricky to make bibliography titles hyperlinks with the current version of Typst (0.11.1). All the alternatives that I could think of don\'t work. Here are some of them:
\\nlink
around the title somehow. This does not work because most URLs contain a colon character (:), and these cause trouble with Typst regexes.#link(url)[title]
. This does not work because the content generated by CSL is not evaluated further by Typst. Also, Typst does not support show rules for the individual bibliography items, which makes it tricky to call eval on them.link
. Some CSL styles already generate link
elements if a URL/DOI is present in the bib entry - one could consider replacing it with a link
whose URL is the same as before, but the text is a link symbol or some such. However, a show rule for a link that generates another link runs into an infinite recursion; Typst made the deliberate decision to handle such recursions only for text
show rules.It would furthermore be desirable to hide the fact that we are reading the same Bibtex file twice behind a single function call. However, code in a Typst package resolves all filenames relative to the package directory, which means that the package cannot access a bibliography file outside of the package directory. We may be able to simplify this once #971 gets addressed.
\\n","description":"This package permits the creation of Typst bibliographies in which paper titles are typeset as hyperlinks. Here\'s an example (with links typeset in blue): The bibliography is generated from a Bibtex file, and citations are done with the usual Typst mechanisms. The hyperlinks…","guid":"https://typst.app/universe/package/blinky","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-08-07T09:11:38.782Z","media":[{"url":"https://raw.githubusercontent.com/alexanderkoller/typst-blinky/blob/main/examples/screenshot.png","type":"photo","width":80}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"silky-report-insa (0.3.1) | A template made for reports and other documents of INSA, a French engineering school.","url":"https://typst.app/universe/package/silky-report-insa","content":"Typst Template for full documents and reports for the french engineering school INSA.
\\n\\n \\n
This is the default report for the silky-report-insa
package. It uses the insa-report
show rule.
\\nIt is primarily used for reports of Practical Works (Travaux Pratiques).
#import \\"@preview/silky-report-insa:0.3.1\\": *\\n#show: doc => insa-report(\\n id: 3,\\n pre-title: \\"STPI 2\\",\\n title: \\"Interférences et diffraction\\",\\n authors: [\\n *LE JEUNE Youenn*\\n\\n *MAUVY Eva*\\n \\n Groupe D\\n\\n Binôme 5\\n ],\\n date: \\"11/04/2023\\",\\n insa: \\"rennes\\",\\n doc)\\n\\n= Introduction\\nLe but de ce TP est d’interpréter les figures de diffraction observées avec différents objets diffractants\\net d’en déduire les dimensions de ces objets.\\n\\n= Partie théorique - Phénomène d\'interférence\\n== Diffraction par une fente double\\nLors du passage de la lumière par une fente double de largeur $a$ et de distance $b$ entre les centres\\ndes fentes...\\n
\\n| Parameter | Description | Type | Example |\\n|-----------|-------------------------------|--------------|--------------------------------|\\n| id | TP number | int | 1
|\\n| pre-title | Text written before the title | str | \\"STPI 2\\"
|\\n| title | Title of the TP | str | \\"Interférences et diffraction\\"
|\\n| authors | Authors | content | [\\\\*LE JEUNE Youenn\\\\*]
|\\n| date | Date of the TP | datetime/str | \\"11/04/2023\\"
|\\n| insa | INSA name (rennes
, hdf
...) | str | \\"rennes\\"
|\\n| lang | Language | str | \\"fr\\"
|
\\n \\n
If you want to make an internship report, you will need to use another show rule: insa-stage
.
#import \\"@preview/silky-report-insa:0.3.1\\": *\\n#show: doc => insa-stage(\\n \\"Youenn LE JEUNE\\",\\n \\"INFO\\",\\n \\"2023-2024\\",\\n \\"Real-time virtual interaction with deformable structure\\",\\n \\"Sapienza University of Rome\\",\\n image(\\"logo-example.png\\"),\\n \\"Marilena VENDITELLI\\",\\n \\"Bertrand COUASNON\\",\\n [\\n Résumé du stage en français.\\n ],\\n [\\n Summary of the internship in english.\\n ],\\n insa: \\"rennes\\",\\n lang: \\"fr\\",\\n doc\\n)\\n\\n= Introduction\\nPrésentation de l\'entreprise, tout ça tout ça.\\n\\n#pagebreak()\\n= Travail réalisé\\n== Première partie\\nBlabla\\n\\n== Seconde partie\\nBleble\\n\\n#pagebreak()\\n= Conclusion\\nConclusion random\\n\\n#pagebreak()\\n= Annexes\\n
\\nThis template can also be used for a report that is written in english: in this case, add the lang: \\"en\\"
parameter to the function call in the show rule.
| Parameter | Required | Type | Description | Example |\\n|-----------------|----------|---------|--------------------------------------------------------|-----------------------------------------------------------|\\n| name | yes | str | Name of the student | \\"Youenn LE JEUNE\\"
|\\n| department | yes | str | Department of the student | \\"INFO\\"
|\\n| year | yes | str | School year during the internship | \\"2023-2024\\"
|\\n| title | yes | str | Title of the internship | \\"Real-time virtual interaction with deformable structure\\"
|\\n| company | yes | str | Company | Sapienza University of Rome
|\\n| company-logo | yes | content | Logo of the company | image(\\"logo-example.png\\")
|\\n| company-tutor | yes | str | Tutor in the company | \\"Marilena VENDITELLI\\"
|\\n| insa-tutor | yes | str | Tutor at INSA | \\"Bertrand COUASNON\\",
|\\n| summary-french | yes | content | Summary in French | [ Résumé du stage en français. ]
|\\n| summary-english | yes | content | Summary in English | [ Summary of the internship in english. ]
|\\n| student-suffix | no | str | Suffix at the end of \\"ingénieur\\" in french | \\"e\\"
|\\n| thanks-page | no | content | Special thanks page. | [ Thanks to my *supervisor*, blah blah blah. ]
|\\n| omit-outline | no | bool | Whether to skip the outline page or not | false
|\\n| insa | no | str | INSA name (rennes
, hdf
...) | \\"rennes\\"
|\\n| lang | no | str | Language of the template. Some strings are translated. | \\"fr\\"
|
\\n \\n
If you do not want the preformatted output with \\"TP x\\", the title and date in the header, etc. you can simply use the insa-document
show rule and customize all by yourself.
The graphic charter provides 3 different document types, that are translated in this Typst template under those names:
\\nlight
, which does not have many color and can be printed easily. Has 3 spots to write on the cover: cover-top-left
, cover-middle-left
and cover-bottom-right
.colored
, which is beautiful but consumes a lot of ink to print. Only has 1 spot to write on the cover: cover-top-left
.pfe
, which is primarily used for internship reports. Has 4 spots to write on both the front and back covers: cover-top-left
, cover-middle-left
, cover-bottom-right
and back-cover
.The document type must be the first argument of the insa-document
function.
#import \\"@preview/silky-report-insa:0.3.1\\": *\\n#show: doc => insa-document(\\n \\"light\\",\\n cover-top-left: [*Document important*],\\n cover-middle-left: [\\n NOM Prénom\\n\\n Département INFO\\n ],\\n cover-bottom-right: \\"uwu\\",\\n page-header: \\"En-tête au pif\\",\\n doc\\n)\\n
\\n| Parameter | Type | Description |\\n|--------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------|\\n| cover-type | str | (REQUIRED) Type of cover. Available are: light, colored, pfe. |\\n| cover-top-left | content | |\\n| cover-middle-left | content | |\\n| cover-bottom-right | content | |\\n| back-cover | content | What to display on the back cover. |\\n| page-header | content | Header of the pages (except the front and back). If none
, will display the INSA logo. If not empty, will display the passed content with an underline. |\\n| page-footer | content | Footer of the pages (except the front and back). The page counter will be displayed at the right of the footer, except if the page number is 0. |\\n| include-back-cover | bool | whether to add the back cover or not. |\\n| insa | str | INSA name (rennes
, hdf
...) | \\"rennes\\"
|\\n| lang | str | Language of the template. Some strings are translated. |\\n| metadata-title | content | Title of the document that will be embedded in the PDF metadata. |\\n| metadata-authors | str list | Authors that will be embedded in the PDF metadata. |\\n| metadata-date | datetime | Date that will be set as the document creation date. If not specified, will be set to now. |
The graphic charter recommends the fonts League Spartan for headings and Source Serif for regular text. To have the best look, you should install those fonts.
\\n\\n\\nYou can download the fonts from here.
\\n
To behave correctly on computers lacking those specific fonts, this template will automatically fallback to similar ones:
\\nIf you want to install those fonts on your computer, Typst might not recognize them if you install their Variable versions. You should install the static versions (League Spartan Bold and most versions of Source Serif).
\\nKeep an eye on the issue in Typst bug tracker to see when variable fonts will be used!
\\nThis template is being developed by Youenn LE JEUNE from the INSA de Rennes in this repository.
\\nFor now it includes assets from the INSA de Rennes and INSA Hauts de France graphic charters, but users from other INSAs can open a pull request on the repository with the correct assets for their INSA.
\\nIf you have any other feature request, open an issue on the repository.
\\nThe typst template is licensed under the MIT license. This does not apply to the image assets. Those image files are property of Groupe INSA and INSA Rennes.
\\ninsa
option to all templatesstudent-suffix
option to insa-stage
omit-outline
option to insa-stage
thanks-page
parameter to insa-stage
insa-document
insa-stage
and insa-report
Simple and colorful template for Typst. This template uses a main color (default is #E94845
) applied to list items, links, inline blocks, selected words and headings. Every page is numbered and has the title of the document and the name of the author at the top.
You can see an example PDF here.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the dashboard and searching for bubble
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/bubble\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the bubble
function with the following named arguments:
title
: Title of the documentsubtitle
: Subtitle of the documentauthor
: Name of the author(s)affiliation
: It is supposed to be the name of your university for exampleyear
: The year you\'re inclass
: For which class this document isother
: Array of other information default is nonedate
: Date of the document, current date if none is set default is current datelogo
: Path of the logo displayed at the top right of the title page, must be set like an image : image(\\"path-to-img\\")
default is nonemain-color
: Main color used in the document default is #E94645
alpha
: Percentage of transparency for the bubbles on the title page default is 60%color-words
: An array of strings that you want to be colored automatically in the main-color (be careful to put a trailing comma if you have only one string in the array as noted here) default is an empty arrayThis template also exports these functions :
\\nblockquote
: Function that highlights quotes with a grey bar at the leftprimary-color
: to use your main colorsecondary-color
: to use your secondary color (which is your main color with the alpha transparency set)If you want to change an existing project to use this template, you can add a show rule like this at the top of your file:
\\n#import \\"@preview/bubble:0.2.2\\": *\\n\\n#show: bubble.with(\\n title: \\"Bubble template\\",\\n subtitle: \\"Simple and colorful template\\",\\n author: \\"hzkonor\\",\\n affiliation: \\"University\\",\\n date: datetime.today().display(),\\n year: \\"Year\\",\\n class: \\"Class\\",\\n other: (\\"Made with Typst\\", \\"https://typst.com\\"),\\n logo: image(\\"logo.png\\"),\\n color-words: (\\"important\\",)\\n) \\n\\n// Your content goes here\\n
\\n","description":"Simple and colorful template for Typst. This template uses a main color (default is #E94845) applied to list items, links, inline blocks, selected words and headings. Every page is numbered and has the title of the document and the name of the author at the top. You can see an…","guid":"https://typst.app/universe/package/bubble","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-08-02T08:25:02.887Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"basic-resume (0.1.3) | A simple, standard resume, designed to work well with ATS.","url":"https://typst.app/universe/package/basic-resume","content":"This is a template for a simple resume. It is intended to be used as a good starting point for quickly crafting a standard resume that will properly be parsed by ATS systems. Inspiration is taken from Jake\'s Resume and guided-resume-starter-cgc. I\'m currently a college student and was unable to find a Typst resume template that fit my needs, so I wrote my own. I hope this template can be useful to others as well.
\\nA barebones resume looks like this, which you can use to get started.
\\n#import \\"@preview/basic-resume:0.1.3\\": *\\n\\n// Put your personal information here, replacing mine\\n#let name = \\"Stephen Xu\\"\\n#let location = \\"San Diego, CA\\"\\n#let email = \\"stxu@hmc.edu\\"\\n#let github = \\"github.com/stuxf\\"\\n#let linkedin = \\"linkedin.com/in/stuxf\\"\\n#let phone = \\"+1 (xxx) xxx-xxxx\\"\\n#let personal-site = \\"stuxf.dev\\"\\n\\n#show: resume.with(\\n author: name,\\n // All the lines below are optional. \\n // For example, if you want to to hide your phone number:\\n // feel free to comment those lines out and they will not show.\\n location: location,\\n email: email,\\n github: github,\\n linkedin: linkedin,\\n phone: phone,\\n personal-site: personal-site,\\n accent-color: \\"#26428b\\",\\n font: \\"New Computer Modern\\",\\n)\\n\\n/*\\n* Lines that start with == are formatted into section headings\\n* You can use the specific formatting functions if needed\\n* The following formatting functions are listed below\\n* #edu(dates: \\"\\", degree: \\"\\", gpa: \\"\\", institution: \\"\\", location: \\"\\")\\n* #work(company: \\"\\", dates: \\"\\", location: \\"\\", title: \\"\\")\\n* #project(dates: \\"\\", name: \\"\\", role: \\"\\", url: \\"\\")\\n* #extracurriculars(activity: \\"\\", dates: \\"\\")\\n* There are also the following generic functions that don\'t apply any formatting\\n* #generic-two-by-two(top-left: \\"\\", top-right: \\"\\", bottom-left: \\"\\", bottom-right: \\"\\")\\n* #generic-one-by-two(left: \\"\\", right: \\"\\")\\n*/\\n== Education\\n\\n#edu(\\n institution: \\"Harvey Mudd College\\",\\n location: \\"Claremont, CA\\",\\n dates: dates-helper(start-date: \\"Aug 2023\\", end-date: \\"May 2027\\"),\\n degree: \\"Bachelor\'s of Science, Computer Science and Mathematics\\",\\n)\\n- Cumulative GPA: 4.0\\\\/4.0 | Dean\'s List, Harvey S. Mudd Merit Scholarship, National Merit Scholarship\\n- Relevant Coursework: Data Structures, Program Development, Microprocessors, Abstract Algebra I: Groups and Rings, Linear Algebra, Discrete Mathematics, Multivariable & Single Variable Calculus, Principles and Practice of Comp Sci\\n\\n== Work Experience\\n\\n#work(\\n title: \\"Subatomic Shepherd and Caffeine Connoisseur\\",\\n location: \\"Atomville, CA\\",\\n company: \\"Microscopic Circus, Schrodinger\'s University\\",\\n dates: dates-helper(start-date: \\"May 2024\\", end-date: \\"Present\\"),\\n)\\n- more bullet points go here\\n\\n// ... more headers and stuff below\\n
\\n","description":"Version 0.1.3 This is a template for a simple resume. It is intended to be used as a good starting point for quickly crafting a standard resume that will properly be parsed by ATS systems. Inspiration is taken from Jake\'s Resume and guided-resume-starter-cgc. I\'m currently a…","guid":"https://typst.app/universe/package/basic-resume","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-08-01T08:06:44.815Z","media":[{"url":"https://raw.githubusercontent.com/stuxf/basic-typst-resume-template/main/example-resume.png","type":"photo","width":1224,"height":1584}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"canonical-nthu-thesis (0.2.0) | A template for master theses and doctoral dissertations for NTHU (National Tsing Hua University).","url":"https://typst.app/universe/package/canonical-nthu-thesis","content":"A Typst template for master theses and doctoral dissertations for NTHU (National Tsing Hua University).
\\n國立清華大學碩士(博士)論文Typst模板。
\\nThis template uses the official fonts from the Ministry of Education of Taiwan (Edukai/TW-MOE-Std-Kai), which are required to be downloaded and installed manually from language.moe.gov.tw. The Typst web app has the fonts installed by default, so there is no need to install the fonts on the web app.
\\n此模板中文部分使用教育部標準楷書字體(Edukai/TW-MOE-Std-Kai),在本地編譯文件前需要自language.moe.gov.tw下載並手動安裝。Typst web app已預裝該字體,故無需額外安裝。
\\nAll the content of the thesis are in the thesis.typ
file.\\nIn the beginning of thesis.typ
, there is a call to the setup-thesis(info, style)
function that configures the metadata (the titles and the author etc.) and the styling of the thesis document.\\nReplace the values with your own.
所有論文內容皆位於thesis.typ
檔案內。該檔案前段的部分呼叫了setup-thesis(info, style)
函式,設置論文的雜項資訊(標題及作者等)及外觀選項,請置換為自己的資訊。
$ typst init @preview/canonical-nthu-thesis:0.2.0 my-thesis\\n$ cd my-thesis\\n$ typst watch thesis.typ\\n
\\nDevelopment and issue tracking happens on the repository on Codeberg.
\\nThis project is licensed under the MIT License.
\\n","description":"A Typst template for master theses and doctoral dissertations for NTHU (National Tsing Hua University). 國立清華大學碩士(博士)論文Typst模板。\\n\\nTypst Universe Package\\nCodeberg Repo\\n\\nUsage\\nInstalling the Chinese fonts\\n\\nThis template uses the official fonts from the Ministry of Education of…","guid":"https://typst.app/universe/package/canonical-nthu-thesis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-08-01T07:50:44.196Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/canonical-nthu-thesis/0.2.0/covers.png","type":"photo","width":1654,"height":1169}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"elsearticle (0.3.0) | Conversion of the LaTeX elsearticle.cls","url":"https://typst.app/universe/package/elsearticle","content":"elsearticle
is a Typst template that aims to mimic the Elsevier article LaTeX class, a.k.a. elsearticle.cls
, provided by Elsevier to format manuscript properly for submission to their journals.
This section provides the minimal amount of information to get started with the template. For more detailed information, see the manual.
\\nTo use the elsearticle
template, you need to include the following line at the beginning of your typ
file:
#import \\"@preview/elsearticle:0.3.0\\": *\\n
\\nAfter importing elsearticle
, you have to initialize the template by a show rule with the #elsearticle()
command. This function takes an optional argument to specify the title of the document.
title
: Title of the paperauthor
: List of the authors of the paperabstract
: Abstract of the paperjournal
: Name of the journalkeywords
: List of keywords of the paperformat
: Format of the paper. Possible values are preprint
, review
, 1p
, 3p
, 5p
numcol
: Number of columns of the paper. Possible values are 1 and 2line-numbering
: Enable line numbering. Possible values are true
and false
The elsearticle
template provides additional features to help you format your document properly.
To activate the appendix environment, all you have to do is to place the following command in your document:
\\n#show: appendix\\n\\n// Appendix content here\\n
\\nSubfigures are not built-in features of Typst, but the elsearticle
template provides a way to handle them. It is based on the subpar
package that allows you to create subfigures and properly reference them.
#subfigure(\\n figure(image(\\"image1.png\\"), caption: []), <figa>,\\n figure(image(\\"image2.png\\"), caption: []), <figb>,\\n columns: (1fr, 1fr),\\n caption: [(a) Left image and (b) Right image],\\n label: <fig>\\n )\\n
\\nThe elsearticle
template provides the #nonumeq()
function to create unnmbered equations. The latter function can be used as follows:
#nonumeq[$\\n y = f(x)\\n $\\n]\\n
\\nArticle format
\\nEnvironment
\\nappendix
environmentFigures and tables
\\nsubfigure
environmentEquations
\\nOther features
\\npar.line
function available from Typst v0.12MIT licensed
\\nCopyright (C) 2024 Mathieu AUCEJO (maucejo)
\\n","description":"elsearticle is a Typst template that aims to mimic the Elsevier article LaTeX class, a.k.a. elsearticle.cls, provided by Elsevier to format manuscript properly for submission to their journals. Basic usage\\n\\nThis section provides the minimal amount of information to get started…","guid":"https://typst.app/universe/package/elsearticle","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-08-01T07:46:49.759Z","media":[{"url":"https://img.shields.io/badge/Version-0.3.0-cornflowerblue.svg","type":"photo","width":90,"height":20,"blurhash":"LID0Goofxuoft7offQof00ayRjj["},{"url":"https://img.shields.io/badge/License-MIT-forestgreen","type":"photo","width":82,"height":20,"blurhash":"L07UI{xufQxu_3j[fQj[fQfQfQfQ"},{"url":"https://img.shields.io/badge/doc-.pdf-mediumpurple","type":"photo","width":60,"height":20,"blurhash":"L07UI{%MfQ%M_3j[fQj[fQfQfQfQ"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"fontawesome (0.5.0) | A Typst library for Font Awesome icons through the desktop fonts.","url":"https://typst.app/universe/package/fontawesome","content":"A Typst library for Font Awesome icons through the desktop fonts.
\\np.s. The library is based on the Font Awesome 6 desktop fonts (v6.6.0)
\\nYou can download the fonts from the official website: https://fontawesome.com/download
\\nAfter downloading the zip file, you can install the fonts depending on your OS.
\\nYou can simply upload the otf
files to the web app and use them with this package.
You can double click the otf
files to install them.
You can right-click the otf
files and select Install
.
This library is tested with the otf files of the Font Awesome Free set. TrueType fonts may not work as expected. (Though I am not sure whether Font Awesome provides TrueType fonts, some issue is reported with TrueType fonts.)
\\nYou can install the library using the typst packages:
\\n#import \\"@preview/fontawesome:0.5.0\\": *
Copy all files start with lib
to your project and import the library:
#import \\"lib.typ\\": *
There are three files:
\\nlib.typ
: The main entrypoint of the library.lib-impl.typ
: The implementation of fa-icon
.lib-gen.typ
: The generated icon map and functions.I recommend renaming these files to avoid conflicts with other libraries.
\\nYou can use the fa-icon
function to create an icon with its name:
#fa-icon(\\"chess-queen\\")
Or you can use the fa-
prefix to create an icon with its name:
#fa-chess-queen()
(This is equivalent to #fa-icon().with(\\"chess-queen\\")
)
You can also set solid
to true
to use the solid version of the icon:
#fa-icon(\\"chess-queen\\", solid: true)
Some icons only have the solid version in the Free set, so you need to set solid
to true
to use them if you are using the Free set.\\nOtherwise, you may not get the expected glyph.
You can find all icons on the official website
\\nBy default, the library supports Free
, Brands
, Pro
, Duotone
and Sharp
sets.\\n(See Enable Pro sets for enabling Pro sets.)
But only Free
and Brands
are tested by me.\\nThat is, three font files are used to test:
Due to some limitations of typst 0.12.0, the regular and solid versions are treated as different fonts.\\nIn this library, solid
is used to switch between the regular and solid versions.
To use other sets or specify one set, you can pass the font
parameter to the inner text
function:
\\nfa-icon(\\"github\\", font: \\"Font Awesome 6 Pro Solid\\")
If you have Font Awesome Pro, please help me test the library with the Pro set.\\nAny feedback is appreciated.
\\nTypst 0.12.0 raise a warning when the font is not found.\\nTo use the Pro set, #fa-use-pro()
should be called before any fa-*
functions.
#fa-use-pro() // Enable Pro sets\\n\\n#fa-icon(\\"chess-queen-piece\\") // Use icons from Pro sets\\n
\\nThe fa-icon
function passes args to text
, so you can customize the icon by passing parameters to it:
#fa-icon(\\"chess-queen\\", fill: blue)
The fa-stack
function can be used to create stacked icons:
#fa-stack(fa-icon-args: (solid: true), \\"square\\", (\\"chess-queen\\", (fill: white, size: 5.5pt)))
Declaration is fa-stack(box-args: (:), grid-args: (:), fa-icon-args: (:), ..icons)
fa-icon-args
is used to set the default args for all icons.box
and grid
by passing the box-args
and grid-args
to the fa-stack
function.fa-icon
function, and the last type is just a content you want to put in the stack.\\nstr
, e.g., \\"square\\"
array
, e.g., (\\"chess-queen\\", (fill: white, size: 5.5pt))
arguments
, e.g. arguments(\\"chess-queen\\", solid: true, fill: white)
content
, e.g. fa-chess-queen(solid: true, fill: white)
typst#2578 typst-fontawesome#2
\\nThis is a known issue that the ligatures may not work in headings, list items, grid items, and other elements. You can use the Unicode from the official website to avoid this issue when using Pro sets.
\\nFor most icons, Unicode is used implicitly. So I assume we usually don\'t need to worry about this.
\\nAny help on this issue is appreciated.
\\nSee the example.typ
file for a complete example.
Feel free to open an issue or a pull request if you find any problems or have any suggestions.
\\nThe helper.py
script is used to get metadata via the GraphQL API and generate typst code. I aim only to use standard python libraries, so running it on any platform with python installed should be easy.
helper.py
: The helper script to get metadata and generate typst code.lib.typ
: The main entrypoint of the library.lib-impl.typ
: The implementation of fa-icon
.lib-gen.typ
: The generated functions of icons.example.typ
: An example file to show how to use the library.gallery.typ
: The generated gallery of icons. It is used in the example file.This library is licensed under the MIT license. Feel free to use it in your project.
\\n","description":"A Typst library for Font Awesome icons through the desktop fonts. p.s. The library is based on the Font Awesome 6 desktop fonts (v6.6.0)\\n\\nUsage\\nInstall the fonts\\n\\nYou can download the fonts from the official website: https://fontawesome.com/download\\n\\nAfter downloading the zip file,…","guid":"https://typst.app/universe/package/fontawesome","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-08-01T07:46:07.473Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"quetta (0.2.0) | Write Tengwar easily with Typst.","url":"https://typst.app/universe/package/quetta","content":"A simple module to write tengwar in Typst.
\\nTo use this module with the Typst web app, you need to upload the font files to your project.
\\nThe main functionality of this module is provided by functions taking content and converting all text in Tenwar:
\\nquenya
converts text using the mode of Quenya,gondor
converts text using the Sindarin mode of Gondor.The original text is used as a phonetic transcription. (This module does not translate English into Quenya or Sindarin.) See the manual for more information.
\\nThe following line may be used to convert the whole document below to Tengwar in Quenya mode (other show
rules might interfere with it):
#show: quetta.quenya\\n
\\nExample:
\\n#import \\"@preview/quetta:0.2.0\\"\\n\\n// Use the function `quenya` to write a small amount of text in Tengwar (Quenya mode)\\n#text(size: 16pt, \\n fill: gradient.linear(blue, green)\\n )[#box(quetta.quenya[_tengwar_])]\\n\\n#v(1em)\\n\\n// A `show` rule may be more convenient for larger contents; beware that it may interfere with other ones, though\\n#show: quetta.quenya\\n\\nNamárië!\\n\\n#h(1em) _Namárië!_\\n\\n#h(2em) *Namárië!*\\n
\\n:
to |
.Initial release with Quenya support.
\\nI (the original author) am definitely not en expert in either Typst nor Tengwar. I could thus use some help in all areas. I would especially welcome contributions or suggestions on the following:
\\n\\n \\n \\n \\n \\n
\\n \\n \\n
\\n \\n \\n
\\n \\n \\n
\\n \\n
This template can be used for extensive documentation as well as for final theses such as bachelor theses.
\\nIt is characterised by the fact that it is highly customisable despite the predefined design.
\\nInitially, all template parameters are optional by default. It is then suitable for documentation.\\nTo make it suitable for theses, only one parameter needs to be changed.
\\nYou can use this template in the Typst web app by clicking “Start from template” on the dashboard and searching for aio-studi-and-thesis
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/aio-studi-and-thesis\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThe template (rendered PDF (DE)) contains thesis writing advice (in German) as example content.
\\nIf you are looking for the details of this template package\'s function, take a look at the german manual or the english manual.
\\n\\n\\nRoboto is used as the default font. Please note accordingly if you want to use exactly this font.
\\n
#import \\"@preview/aio-studi-and-thesis:0.1.0\\": *\\n\\n#show: project.with(\\n lang: \\"de\\",\\n authors: (\\n (name: \\"Firstname Lastname\\"),\\n ),\\n title: \\"Title\\",\\n subtitle: \\"Subtitle\\",\\n cover-sheet: (\\n cover-image: none,\\n description: []\\n )\\n)\\n
\\nIf you think this template is useful and saves you a lot of work and nerves (Word and LaTex can be very tiring) and lets you sleep better, then a small donation would be very nice.
\\n\\n","description":"This template can be used for extensive documentation as well as for final theses such as bachelor theses. It is characterised by the fact that it is highly customisable despite the predefined design.\\n\\nInitially, all…","guid":"https://typst.app/universe/package/aio-studi-and-thesis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-31T12:32:49.094Z","media":[{"url":"https://img.shields.io/website?down_message=offline&label=manual%20de&up_color=007aff&up_message=online&url=https%3A%2F%2Fgithub.com%2Ffuchs-fabian%2Ftypst-template-aio-studi-and-thesis%2Fblob%2Fmain%2Fdocs%2Fmanual-de.pdf","type":"photo","width":112,"height":20},{"url":"https://img.shields.io/website?down_message=offline&label=manual%20en&up_color=007aff&up_message=online&url=https%3A%2F%2Fgithub.com%2Ffuchs-fabian%2Ftypst-template-aio-studi-and-thesis%2Fblob%2Fmain%2Fdocs%2Fmanual-en.pdf","type":"photo","width":112,"height":20},{"url":"https://img.shields.io/website?down_message=offline&label=example%20de&up_color=007aff&up_message=online&url=https%3A%2F%2Fgithub.com%2Ffuchs-fabian%2Ftypst-template-aio-studi-and-thesis%2Fblob%2Fmain%2Fdocs%2Fexample-de-thesis.pdf","type":"photo","width":118,"height":20},{"url":"https://img.shields.io/website?down_message=offline&label=example%20en&up_color=007aff&up_message=online&url=https%3A%2F%2Fgithub.com%2Ffuchs-fabian%2Ftypst-template-aio-studi-and-thesis%2Fblob%2Fmain%2Fdocs%2Fexample-en-thesis.pdf","type":"photo","width":118,"height":20},{"url":"https://img.shields.io/badge/license-MIT-brightgreen","type":"photo","width":78,"height":20},{"url":"https://www.paypalobjects.com/de_DE/i/btn/btn_donateCC_LG.gif","type":"photo","width":126,"height":47}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"definitely-not-tuw-thesis (0.1.0) | An unofficial template for a thesis at the TU Wien informatics institute.","url":"https://typst.app/universe/package/definitely-not-tuw-thesis","content":"An example thesis can be viewed here: https://otto-aa.github.io/definitely-not-tuw-thesis/thesis.pdf
\\nYou can download the template with:
\\ntypst init @preview/definitely-not-tuw-thesis\\n
\\nAfter setting up the template, you will have the following files:
\\nthesis.typ
: overall structure and styling, configuration for the cover pages and PDF metadatacontent/front-matter.typ
: acknowledgments and abstractcontent/main.typ
: all your chapterscontent/appendix.typ
: AI tools acknowledgment and other appendicesrefs.bib
: referencesThen copy the values you get from compiling the official template, and paste them in thesis.typ
. Remove all unused fields and, finally, compare if it is close enough to the official template. If not, please open an issue or PR to fix it.
If you want to adapt the styling, you can remove the show: ...
commands in the thesis.typ
and replace them with your own, or simply extend them with your own show: ...
commands.
I guess there are many ways to improve this template, feel free to do so and submit issues and PRs! More information at CONTRIBUTING.md
\\nThe code is licensed under MIT-0. The \'TU Wien Informatics\' logo and signet are copyright of the TU Wien.
\\nThis work is based on the official template maintained by Thomas Auzinger. The repository structure is based on typst-package-template.
\\n","description":"An example thesis can be viewed here: https://otto-aa.github.io/definitely-not-tuw-thesis/thesis.pdf Usage\\n\\nYou can download the template with:\\n\\ntypst init @preview/definitely-not-tuw-thesis\\n\\nTemplate overview\\n\\nAfter setting up the template, you will have the following files:\\n\\nthes…","guid":"https://typst.app/universe/package/definitely-not-tuw-thesis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-29T08:17:16.294Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"pavemat (0.1.0) | Style matrices with custom paths, strokes and fills for appealing visualizations.","url":"https://typst.app/universe/package/pavemat","content":"repo: https://github.com/QuadnucYard/pavemat
\\nThe pavemat is a tool for creating styled matrices with custom paths, strokes, and fills. It allows users to define how paths should be drawn through the matrix, apply different strokes to these paths, and fill specific cells with various colors. This function is particularly useful for visualizing complex data structures, mathematical matrices, and creating custom grid layouts.
\\nThe logo example:
\\n#{\\n set math.mat(row-gap: 0.25em, column-gap: 0.1em)\\n set text(size: 2em)\\n\\n pavemat(\\n pave: (\\n \\"SDS(dash: \'solid\')DDD]WW\\",\\n (path: \\"sdDDD\\", stroke: aqua.darken(30%))\\n ),\\n stroke: (dash: \\"dashed\\", thickness: 1pt, paint: yellow),\\n fills: (\\n \\"0-0\\": green.transparentize(80%),\\n \\"1-1\\": blue.transparentize(80%),\\n \\"[0-0]\\": green.transparentize(60%),\\n \\"[1-1]\\": blue.transparentize(60%),\\n ),\\n delim: \\"[\\",\\n )[$mat(P, a, v, e; \\"\\", m, a, t)$]\\n}\\n
\\nCode of examples can be found in examples/examples.typ
.
\\n
\\n
\\n
See docs/manual.typ
.
Attempt at creating a songbook package to replace patacrep (which is based on LaTeX + Songs).
\\nFirst, create a main.typ
file, like the following:
#set page(paper: \\"a6\\",margin: (inside: 14mm, outside: 6mm, y: 10mm))\\n\\n#import \\"@preview/songb:0.1.0\\": autobreak, index-by-letter\\n\\n// helper function, to include you own songs (feel free to customize)\\n#let song(path) = {\\n // WARNING: autobreak is currently broken (does not converge)\\n // see https://github.com/typst/typst/discussions/4530\\n autobreak(include path)\\n v(-1.19em)\\n}\\n\\n// indexes (put them wherever you want, or comment them out)\\n= Song Index\\n#index-by-letter(<song>)\\n\\n= Singer Index\\n#index-by-letter(<singer>)\\n\\n#pagebreak()\\n\\n// include all you songs, in the right order\\n#song(\\"./songs/first_song.typ\\")\\n\\n#song(\\"./songs/other_song.typ\\")\\n\\n// ...\\n
\\nThen, create your song files, like songs/first_song.typ
:
#import \\"@preview/songb:0.1.0\\": song, chorus, verse, chord\\n\\n#show: doc => song(\\n title: \\"First Song\\",\\n singer: \\"Sing\\",\\n doc,\\n)\\n\\n#chorus[\\n #chord[Am]First line,#chord[G][ ]of the chorus\\\\\\n #chord[Am]Second line,#chord[G][ ]of the chorus.\\n]\\n\\n\\n#verse[\\n #chord[Em]First verse\\\\\\n With multiple\\\\\\n #chord[C]Lines\\n]\\n\\nIf there is #chord[D][a] bridge\\\\\\nyou can write it directly\\n
\\n#let song(\\n title: none,\\n title-index: none,\\n singer: none,\\n singer-index: none,\\n references: (),\\n line-color: rgb(0xd0, 0xd0, 0xd0),\\n header-display: (number, title, singer) => (...),\\n doc\\n)\\n
\\n// first argument: chord name\\n// optional second argument: text below the chord (useful for whitespace for instance)\\n#let chord(..content)\\n
\\n#let verse(body)\\n
\\n#let chorus(body)\\n
\\n\\n\\n[!WARNING]\\nCurrently broken (lack of convergence for bigger documents)\\nSee https://github.com/typst/typst/discussions/4530
\\n
This function aims at putting the content on a single page (or on facing pages), by introducing pagebreaks when needed.
\\n#let autobreak(content)\\n
\\n#let index-by-letter(label, letter-highlight: (letter) => (...))\\n
\\nlabel: <song>
or <singer>
are provided by the song
function.
Hydra is a Typst package allowing you to easily display the heading like elements anywhere in your\\ndocument. It\'s primary focus is to provide the reader with a reminder of where they currently are in\\nyour document only when it is needed.
\\n#import \\"@preview/hydra:0.5.1\\": hydra\\n\\n#set page(paper: \\"a7\\", margin: (y: 4em), numbering: \\"1\\", header: context {\\n if calc.odd(here().page()) {\\n align(right, emph(hydra(1)))\\n } else {\\n align(left, emph(hydra(2)))\\n }\\n line(length: 100%)\\n})\\n#set heading(numbering: \\"1.1\\")\\n#show heading.where(level: 1): it => pagebreak(weak: true) + it\\n\\n= Introduction\\n#lorem(50)\\n\\n= Content\\n== First Section\\n#lorem(50)\\n== Second Section\\n#lorem(100)\\n
\\nFor a more in-depth description of hydra\'s functionality and the reference read its manual.
\\nFor contributing, please take a look CONTRIBUTING.
\\nThe package name hydra /ˈhaɪdrə/ is a word play headings and headers, inspired by the monster in\\ngreek and roman mythology resembling a serpent with many heads.
\\n","description":"Hydra is a Typst package allowing you to easily display the heading like elements anywhere in your document. It\'s primary focus is to provide the reader with a reminder of where they currently are in your document only when it is needed. Example\\n#import \\"@preview/hydra:0.5.1…","guid":"https://typst.app/universe/package/hydra","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-25T12:05:20.525Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/hydra/0.5.1/examples/example.png","type":"photo","width":7102,"height":2524}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"simple-preavis (0.1.0) | 📖 a french move out letter","url":"https://typst.app/universe/package/simple-preavis","content":"simple-preavis est un template typst pour écrire une lettre de préavis d\'état des lieux à son propriétaire.
\\nIl est fortement inspiré de cet outil réalisés par les services publics 🙏.
\\n#import \\"@preview/simple-preavis:0.1.0\\":*\\n#lettre-preavis(\\n locataire: locataire(\\n \\"Dupont locataire\\",\\n \\"Jean\\",\\n adresse(\\n \\"123 rue de la Paix\\",\\n \\"75000\\",\\n \\"Paris\\",\\n complement: \\"Appartement 2\\"\\n )\\n ),\\n proprietaire: proprietaire(\\n \\"Martin proprietaire\\",\\n \\"Sophie\\",\\n adresse(\\n \\"456 avenue des Champs-Élysées\\",\\n \\"75008\\",\\n \\"Paris\\"\\n ),\\n \\"Madame\\"\\n ),\\n date-etat-des-lieux: datetime(year:2024, month:9, day:21)\\n)\\n
\\nConformément à la license etalab
\\nCreate TODO comments, which are displayed at the sides of the page.
\\nThe package provides a todo(message, position: auto | left | right)
method. Call it anywhere you need a todo message.
#import \\"@preview/dashy-todo:0.0.1\\": todo\\n\\n// It automatically goes to the closer side (left or right)\\nA todo on the left #todo[On the left].\\n\\n// You can specify a side if you want to\\n#todo(position: right)[Also right]\\n\\n// You can add arbitrary content\\n#todo[We need to fix the $lim_(x -> oo)$ equation. See #link(\\"https://example.com\\")[example.com]]\\n\\n// And you can create an outline for the TODOs\\n#outline(title: \\"TODOs\\", target: figure.where(kind: \\"todo\\"))\\n
\\nYou can modify the text by wrapping it, e.g.:
\\n#let small-todo = (..args) => text(size: 0.6em)[#todo(..args)]\\n\\n#small-todo[This will be in fine print]\\n
\\n","description":"Create TODO comments, which are displayed at the sides of the page. Usage\\n\\nThe package provides a todo(message, position: auto | left | right) method. Call it anywhere you need a todo message.\\n\\n#import \\"@preview/dashy-todo:0.0.1\\": todo\\n\\n// It automatically goes to the closer side…","guid":"https://typst.app/universe/package/dashy-todo","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-23T08:09:57.959Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/dashy-todo/0.0.1/example.svg","type":"photo","width":944,"height":590}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"board-n-pieces (0.5.0) | Display chessboards.","url":"https://typst.app/universe/package/board-n-pieces","content":"Display chessboards in Typst.
\\nThe main function of this package is board
. It lets you display a specific position on a board.
#board(starting-position)\\n
\\nstarting-position
is a position that is provided by the package. It represents the initial position of a chess game.
You can create a different position using the position
function. It accepts strings representing each rank. Use upper-case letters for white pieces, and lower-case letters for black pieces. Dots and spaces correspond to empty squares.
#board(position(\\n \\"....r...\\",\\n \\"........\\",\\n \\"..p..PPk\\",\\n \\".p.r....\\",\\n \\"pP..p.R.\\",\\n \\"P.B.....\\",\\n \\"..P..K..\\",\\n \\"........\\",\\n))\\n
\\nAlternatively, you can use the fen
function to create a position using Forsyth–Edwards notation:
#board(fen(\\"r1bk3r/p2pBpNp/n4n2/1p1NP2P/6P1/3P4/P1P1K3/q5b1 b - - 1 23\\"))\\n
\\nNote that you can specify only the first part of the FEN string:
\\n#board(fen(\\"r4rk1/pp2Bpbp/1qp3p1/8/2BP2b1/Q1n2N2/P4PPP/3RK2R\\"))\\n
\\nAlso note that positions do not need to be on a standard 8×8 board:
\\n#board(position(\\n \\"....Q....\\",\\n \\"......Q..\\",\\n \\"........Q\\",\\n \\"...Q.....\\",\\n \\".Q.......\\",\\n \\".......Q.\\",\\n \\".....Q...\\",\\n \\"..Q......\\",\\n \\"Q........\\",\\n))\\n
\\ngame
functionThe game
function creates an array of positions from a full chess game. A game is described by a series of turns written in standard algebraic notation. Those turns can be specified as an array of strings, or as a single string containing whitespace-separated moves.
The scholar\'s mate:\\n#let positions = game(\\"e4 e5 Qh5 Nc6 Bc4 Nf6 Qxf7\\")\\n#grid(\\n columns: 4,\\n gutter: 0.2cm,\\n ..positions.map(board.with(square-size: 0.5cm)),\\n)\\n
\\nYou can specify an alternative starting position to the game
function with the starting-position
named argument.
pgn
function to import PGN filesSimilarly to the game
function, the pgn
function creates an array of positions. It accepts a single argument, which is a string containing portable game notation. To read a game from a PGN file, you can use this function in combination with Typst\'s native read
function.
#let positions = pgn(read(\\"game.pgn\\"))\\n
\\nNote that the argument to pgn
must describe a single game. If you have a PGN file containing multiple games, you will need to split them using other means.
The board
function\'s pieces
argument lets you specify how to display each piece by mapping each piece character to some content. You can use this feature to display non-standard chess pieces:
#board(\\n fen(\\"g7/5g2/8/8/8/8/p6g/k1K4G\\"),\\n pieces: (\\n // We use symbols for the example.\\n // In practice, you should import your own images.\\n g: chess-sym.queen.black.b,\\n p: chess-sym.pawn.black,\\n k: chess-sym.king.black,\\n K: chess-sym.king.white,\\n G: chess-sym.queen.white.b,\\n ),\\n)\\n
\\nThe board
function lets you customize the appearance of the board in various ways, as illustrated in the example below.
// From https://lichess.org/study/Xf1PGrM0.\\n#board(\\n fen(\\"3k4/7R/8/2PK4/8/8/8/6r1 b - - 0 1\\"),\\n\\n marked-squares: \\"c7 c6 h6\\",\\n arrows: (\\"d8 c8\\", \\"d8 c7\\", \\"g1 g6\\", \\"h7 h6\\"),\\n display-numbers: true,\\n\\n white-square-fill: rgb(\\"#d2eeea\\"),\\n black-square-fill: rgb(\\"#567f96\\"),\\n marking-color: rgb(\\"#2bcbC6\\"),\\n arrow-stroke: 0.2cm + rgb(\\"#38f442df\\"),\\n\\n stroke: 0.8pt + black,\\n)\\n
\\nHere is a list of all the available arguments:
\\nmarked-squares
is a list of squares to mark (e.g., (\\"d3\\", \\"d2\\", \\"e3\\")
). It can also be specified as a single string containing whitespace-separated squares (e.g., \\"d3 d2 e3\\"
).
arrows
is a list of arrows to draw (e.g., (\\"e2 e4\\", \\"e7 e5\\")
).
reverse
is a boolean indicating whether to reverse the board, displaying it from black\'s point of view. This is false
by default, meaning the board is displayed from white\'s point of view.
display-numbers
is a boolean indicating whether ranks and files should be numbered. This is false
by default.
rank-numbering
and file-numbering
are functions describing how ranks and files should be numbered. By default they are respectively numbering.with(\\"1\\")
and numbering.with(\\"a\\")
.
square-size
is a length describing the size of each square. By default, this is 1cm
.
white-square-fill
and black-square-fill
indicate how squares should be filled. They can be colors, gradient or patterns.
marking-color
is the color to use for markings (marked squares and arrows).
marked-white-square-background
and marked-black-square-background
define the content to display in the background of marked squares. By default, this is a circle using the marking-color
.
arrow-stroke
is the stroke to draw the arrows with. If only a length is given, marking-color
is used. Alternatively, a stroke can be passed to specify a different color.
pieces
is a dictionary containing images representing each piece. If specified, the dictionary must contain an entry for every piece kind in the displayed position. Keys are single upper-case letters for white pieces and single lower-case letters for black pieces. The default images are taken from Wikimedia Commons. Please refer to the section on licensing for information on how you can use them in your documents.
stroke
has the same structure as rect
\'s stroke
parameter and corresponds to the stroke to use around the board. If display-numbers
is true
, the numbers are displayed outside the stroke. The default value is none
.
This package also exports chess symbols for all Unicode chess-related codepoints under the chess-sym
submodule. Standard chess pieces are available as chess-sym.{pawn,knight,bishop,rook,queen,king}.{white,black,neutral}
. Alternatively, you can use stroked
and filled
instead of, respectively, white
and black
. They can be rotated rightward, downward, and leftward respectively with with .r
, .b
, and .l
. Chinese chess pieces are also available as chess-sym.{soldier,cannon,chariot,horse,elephant,mandarin,general}.{red,black}
. Similarly, you can use stroked
and filled
as alternatives to, respectively, red
and black
. Note that most fonts only support black and white versions of standard pieces. To use the other symbols, you may have to use a font such as Noto Sans Symbols 2.
The best move in this position is #chess-sym.knight.white;c6.\\n
\\nThe default images for chess pieces used by the board
function come from Wikimedia Commons. They are all licensed the GNU General Public License, version 2 by their original author: Cburnett.
Add symbols for all Unicode chess-related codepoints.
\\nChange the signature of the board
function.
highlighted-squares
to marked-squares
.highlighted-white-square-fill
and highlighted-black-square-fill
.marking-color
, together with marked-white-square-background
and marked-black-square-background
.arrow-stroke
.Fix arrows not being displayed properly on reversed boards.
\\nboard
.Detect moves that put the king in check as illegal, improving SAN support.
\\nAdd stroke
argument to the board
function.
Rename {highlighted-,}{white,black}-square-color
arguments to the board
function to {highlighted-,}{white,black}-square-fill
.
Allow using dashes for empty squares in position
function.
Allow passing highlighted squares as a single string of whitespace-separated squares.
\\nDescribe entire games using algebraic notation with the game
function.
Initial PGN support through the pgn
function.
Display a chess position on a chessboard with the board
function.
Get the starting position with starting-position
.
Use chess-related symbols with the chess-sym
module.
easy slides in typst
\\nFeatures:
\\nExample Presentation
\\n| Title Slide | Section | Content | Outline |\\n| ----------------------------------------------- | --------------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |\\n| |
|
|
|
can be found in example/example.typ
in the GitHub Repo
To start a presentation, initialize it in your typst document:
\\n#show: slides.with(\\n title: \\"Diatypst\\", // Required\\n subtitle: \\"easy slides in typst\\",\\n date: \\"01.07.2024\\",\\n authors: (\\"John Doe\\"),\\n)\\n...\\n
\\nThen, insert your content.
\\n...\\n\\n#outline()\\n\\n= First Section\\n\\n== First Slide\\n\\n#lorem(20)\\n
\\nall available Options to initialize the template with
\\n| Keyword | Description | Default |\\n| ------------- | ------------------------------------------------------------ | -------------------- |\\n| title | Title of your Presentation, visible also in footer | none
but required! |\\n| subtitle | Subtitle, also visible in footer | none
|\\n| date | a normal string presenting your date | none
|\\n| authors | either string or array of strings | none
|\\n| layout | one of \\"small\\", \\"medium\\", \\"large\\", adjusts sizing of the elements on the slides | \\"medium\\"
|\\n| ratio | aspect ratio of the slides, e.g 16/9 | 4/3
|\\n| title-color | Color to base the Elements of the Presentation on | blue.darken(50%)
|\\n| counter | whether to display the dots for pages in upper right corner | true
|\\n| footer | whether to display the footer at the bottom | true
|
this template is inspired by slydst, and takes part of the code from it. If you want simpler slides, look here!
\\nThe word Diatypst is inspired by the ease of use of a Dia-projektor (German for Slide Projector) and the Diatype
\\n","description":"easy slides in typst Features:\\n\\neasy delimiter for slides and sections (just use headings)\\nsensible styling\\ndot counter in upper right corner (like LaTeX beamer)\\nadjustable color-theme\\ndefault show rules for terms, code, lists, ... that match color-theme\\n\\nExample Presentation\\n\\n|…","guid":"https://typst.app/universe/package/diatypst","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-22T08:52:39.705Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/diatypst/0.1.0/screenshots/Example-Title.jpg","type":"photo","width":1922,"height":1390},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/diatypst/0.1.0/screenshots/Example-Section.jpg","type":"photo","width":1922,"height":1432},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/diatypst/0.1.0/screenshots/Example-Slide.jpg","type":"photo","width":1910,"height":1412},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/diatypst/0.1.0/screenshots/Example-TOC.jpg","type":"photo","width":1868,"height":1392}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"grape-suite (1.0.0) | Library of templates for exams, seminar papers, homeworks, etc.","url":"https://typst.app/universe/package/grape-suite","content":"The grape suite is a suite consisting of following templates:
\\nexercises (for exams, homework, etc.)
\\nseminar papers
\\nslides (using polylux)
\\n#import \\"@preview/grape-suite:1.0.0\\": exercise\\n#import exercise: project, task, subtask\\n\\n#show: project.with(\\n title: \\"Lorem ipsum dolor sit\\",\\n\\n university: [University],\\n institute: [Institute],\\n seminar: [Seminar],\\n\\n abstract: lorem(100),\\n show-outline: true,\\n\\n author: \\"John Doe\\",\\n\\n show-solutions: false\\n)\\n
\\n| project
| |\\n| :--------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\\n| no
| optional, number, default: none
, number of the sheet in the series |\\n| type
| optional, content, default: [Exam]
, type of the series, eg. exam, homework, protocol, ... |\\n| title
| optional, content, default: none
, title of the document: if none, then generated from no, type and suffix-title |\\n| suffix-title
| optional, content, default: none
, used if title is none to generate the title of the document |\\n| show-outline
| optional, bool, default: false
, show outline after title iff true |\\n| abstract
| optional, content, default: none
, show abstract between outline and title |\\n| document-title
| optional, content, default: none
, shown in the upper right corner of the page header: if none, title
is used |\\n| show-hints
| optional, bool, default: false
, generate hints from tasks iff true |\\n| show-solutions
| optional, bool, default: false
, generate solutions from tasks iff true |\\n| show-namefield
| optional, bool, default: false
, show namefield at the end of the left header iff true |\\n| namefield
| optional, content, default: [Name:]
, content shown iff show-namefield
|\\n| show-timefield
| optional, bool, default: false
, show timefield at the end of right header iff true |\\n| timefield
| optional, function, default: (time) => [Time: #time min.]
, to generate the content shown as the timefield iff show-timefield
is true |\\n| max-time
| optional, number, default: 0
, time value used in the timefield
function generateor |\\n| show-lines
| optional, bool, default: false
, draw automatic lines for each task, if lines
parameter of task
is set |\\n| show-point-distribution-in-tasks
| optional, bool, default: false
, show point distribution after tasks iff true |\\n| show-point-distribution-in-solutions
| optional, bool, default: false
, show point distributions after solutions iff true |\\n| solutions-as-matrix
| optional, bool, default: false
, show solutions as a matrix iff true, mind that: now the solution parameter of task expects a list of 2-tuples, where the first element of the 2-tuple is the amount of points, a number and the second element is content, how to achieve all points |\\n| university
| optional, content, default: none
|\\n| faculty
| optional, content, default: none
|\\n| institute
| optional, content, default: none
|\\n| seminar
| optional, content, default: none
|\\n| semester
| optional, content, default: none
|\\n| docent
| optional, content, default: none
|\\n| author
| optional, content, default: none
|\\n| date
| optional, datetime, default: datetime.today()
|\\n| header
| optional, content, default: none
, overwrite page header |\\n| header-right
| optional, content, default: none
, overwrite right header part |\\n| header-middle
| optional, content, default: none
, overwrite middle header part |\\n| header-left
| optional, content, default: none
, overwrite left header part |\\n| footer
| optional, content, default: none
, overwrite footer part |\\n| footer-right
| optional, content, default: none
, overwrite right footer part |\\n| footer-middle
| optional, content, default: none
, overwrite middle footer part |\\n| footer-left
| optional, content, default: none
, overwrite left footer part |\\n| task-type
| optional, content, default: [Task]
, content shown in task title box before numbering |\\n| extra-task-type
| optional, content, default: [Extra task]
, for tasks where the extra
parameter is true, content shown in title box before numbering |\\n| box-task-title
| optional, content, default: [Task]
, shown as the title of a task box used by the slides
library |\\n| box-hint-title
| optional, content, default: [Hint]
, shown as the title of a tasks colored hint box |\\n| box-solution-title
| optional, content, default: [Solution]
, shown as the title of a tasks colored solution box |\\n| box-definition-title
| optional, content, default: [Definition]
, shown as the title of a definition box used by the slides
library |\\n| box-notice-title
| optional, content, default: [Notice]
, shown as the title of a notice box used by the slides
library |\\n| box-example-title
| optional, content, default: [Example]
, shown as the title of a example box used by the slides
library |\\n| hint-type
| optional, content, default: [Hint]
, title of a tasks hint version |\\n| hints-title
| optional, content, default: [Hints]
, title of the hints section |\\n| solution-type
| optional, content, default: [Suggested solution]
, title of a tasks solution version |\\n| solutions-title
| optional, content, default: [Suggested solutions]
, title of the solutions section |\\n| solution-matrix-task-header
| optional, content, default: [Tasks]
, first column header of solution matrix, column contains the reasons on how to achieve the points |\\n| solution-matrix-achieved-points-header
| optional, content, default: [Points achieved]
, second column header of solution matrix, column contains the points the one achieved |\\n| show-solution-matrix-comment-field
| optional, bool, default: false
, show comment field in solution matrix |\\n| solution-matrix-comment-field-value
| optional, content, default: [*Note:* #v(0.5cm)]
, value of solution matrix comment fields |\\n| distribution-header-point-value
| optional, content, default: [Point]
, first row of point distribution, used to indicate the points needed to get a specific grade |\\n| distribution-header-point-grade
| optional, content, default: [Grade]
, second row of point distribution |\\n| message
| optional, function, default: (points-sum, extrapoints-sum) => [In sum #points-sum + #extrapoints-sum P. are achievable. You achieved #box(line(stroke: purple, length: 1cm)) out of #points-sum points.]
, used to generate the message part above the point distribution |\\n| grade-scale
| optional, array, default: (([excellent], 0.9), ([very good], 0.8), ([good], 0.7), ([pass], 0.6), ([fail], 0.49))
, list of grades and percentage of points to reach that grade |\\n| page-margins
| optional, margins, default: none
, overwrite page margins |\\n| fontsize
| optional, size, default: 11pt
, overwrite font size |\\n| show-todolist
| optional, bool, default: true
, show list of usages of the todo
function after the outline |\\n| body
| content, document content |
task
creates a task element in an exercise project.
| task
| |\\n| :----------------- | :------------------------------------------------------------------------------------------------------------------------------------------ |\\n| lines
| optional, number, default: 0
, number of lines to draw if show-lines
in exercise\'s project
is set to true
|\\n| points
| optional, number, default: 0
, number of points achievable |\\n| extra
| optional, bool, default: false
, determines if the task is obligatory (false
) or additional (true
) |\\n| numbering-format
| optional, function, default: none
, |\\n| title
| content, title of the task |\\n| instruction
| content, instruction of the task, highlighted |\\n| ..args
| 1: content, task body; 2: content, task solution, not highlighted (see solution-as-matrix
of exercise\'s project
), 3: content, task hint |
subtask
creates a part of a task. Its points are added to the parent task. Subtasks are to be use inside of the task\'s body or inside of another subtask\'s body.
| subtask
| |\\n| :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |\\n| points
| optional, number, default: 0
, points achievable, adds to a tasks point |\\n| tight
| optional, bool, default: false
, enum style |\\n| markers
| optional, array, default: (\\"1.\\", \\"a)\\")
, numbering format for each level, fallback is i.
|\\n| show-points
| optional, bool, default: true
, show points next to subtask\'s body iff true
|\\n| counter
| optional, counter, default: none
, change number styled by the numbering format; if none
, each level has an incrementel auto counter |\\n| content
| content, subtask body |
#import \\"@preview/grape-suite:1.0.0\\": seminar-paper\\n\\n#show: seminar-paper.project.with(\\n title: \\"Die Intensionalität von dass-Sätzen\\",\\n subtitle: \\"Intensionale Kontexte in philosophischen Argumenten\\",\\n\\n university: [Universität Musterstadt],\\n faculty: [Exemplarische Fakultät],\\n institute: [Institut für Philosophie],\\n docent: [Dr. phil. Berta Beispielprüferin],\\n seminar: [Beispielseminar],\\n\\n submit-to: [Eingereicht bei],\\n submit-by: [Eingereicht durch],\\n\\n semester: german-dates.semester(datetime.today()),\\n\\n author: \\"Max Muster\\",\\n email: \\"max.muster@uni-musterstadt.uni\\",\\n address: [\\n 12345 Musterstadt \\\\\\n Musterstraße 67\\n ]\\n)\\n
\\n| project
| |\\n| :------------------------------------- | :-------------------------------------------------------------------------------------------- |\\n| title
| optional, content, default: none
, title used on the title page |\\n| subtitle
| optional, content, default: none
, subtitle used on title page |\\n| submit-to
| optional, content, default: \\"Submitted to\\"
, title for the assignees\'s section |\\n| submit-by
| optional, content, default: \\"Submitted by\\"
, title for the assigned\'s section |\\n| university
| optional, content, default: \\"UNIVERSITY\\"
|\\n| faculty
| optional, content, default: \\"FACULTY\\"
|\\n| institute
| optional, content, default: \\"INSTITUTE\\"
|\\n| seminar
| optional, content, default: \\"SEMINAR\\"
|\\n| semester
| optional, content, default: \\"SEMESTER\\"
|\\n| docent
| optional, content, default: \\"DOCENT\\"
|\\n| author
| optional, content, default: \\"AUTHOR\\"
|\\n| email
| optional, content, default: \\"EMAIL\\"
|\\n| address
| optional, content, default: \\"ADDRESS\\"
|\\n| title-page-part
| optional, content, default: none
, overwrite date, assignee and assigned section |\\n| title-page-part-submit-date
| optional, content, default: none
, overwrite date section |\\n| title-page-part-submit-to
| optional, content, default: none
, overwrite assignee section |\\n| title-page-part-submit-by
| optional, content, default: none
, overwrite assigned section |\\n| date
| optional, datetime, default: datetime.today()
|\\n| date-format
| optional, function, default: (date) => date.display(\\"[day].[month].[year]\\")
|\\n| header
| optional, content, default: none
, overwrite page header |\\n| header-right
| optional, content, default: none
, overwrite right header part |\\n| header-middle
| optional, content, default: none
, overwrite middle header part |\\n| header-left
| optional, content, default: none
, overwrite left header part |\\n| footer
| optional, content, default: none
, overwrite footer part |\\n| footer-right
| optional, content, default: none
, overwrite right footer part |\\n| footer-middle
| optional, content, default: none
, overwrite middle footer part |\\n| footer-left
| optional, content, default: none
, overwrite left footer part |\\n| show-outline
| optional, bool, default: true
, show outline |\\n| show-declaration-of-independent-work
| optional, bool, default: true
, show German declaration of independent work |\\n| page-margins
| optional, margins, default: none
, overwrite page margins |\\n| fontsize
| optional, size, default: 11pt
, overwrite fontsize |\\n| show-todolist
| optional, bool, default: true
, show list of usages of the todo
function after the outline |\\n| body
| content, document content |
| sidenote
| |\\n| :--------- | :------------------------------------------------------------------------------------------------------ |\\n| body
| sidenote content, which is a block with 3cm width and will be displayed in the right margin of the page |
#import \\"@preview/grape-suite:1.0.0\\": slides\\n#import slides: *\\n\\n#show: slides.with(\\n no: 1,\\n series: [Logik-Tutorium],\\n title: [Organisatorisches und Einführung in die Logik],\\n\\n author: \\"Tristan Pieper\\",\\n email: link(\\"mailto:tristan.pieper@uni-rostock.de\\"),\\n)\\n
\\n| slides
| |\\n| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ |\\n| no
| optional, number, default: 0
, number in the series |\\n| series
| optional, content, default: none
, name of the series |\\n| title
| optional, content, default: none
, title of the presentation |\\n| topics
| optional, array, default: ()
, topics of the presentation |\\n| author
| optional, content, default: none
, author |\\n| email
| optional, content, default: none
, author\'s email |\\n| head-replacement
| optional, content, default: none
, replace head on title slide with given content |\\n| title-replacement
| optional, content, default: none
, replace title below head on title slide with given content |\\n| footer
| optional, content, default: none
, replace footer on slides with given content |\\n| page-numbering
| optional, function, default: (n, total) => {...}
, function that creates the page numbering (where n
is the current, total
is the last page) |\\n| show-semester
| optional, bool, default: true
, show name of the semester (e.g. \\"SoSe 24\\") |\\n| show-date
| optional, bool, default: true
, show date in german format |\\n| show-outline
| optional, bool, default: true
, show outline on the second slide |\\n| box-task-title
| optional, content, default: [Task]
, shown as the title of a slide\'s task box |\\n| box-hint-title
| optional, content, default: [Hint]
, shown as the title of a slide\'s tasks colored |\\n| box-solution-title
| optional, content, default: [Solution]
, shown as the title of a slide\'s tasks colored |\\n| box-definition-title
| optional, content, default: [Definition]
, shown as the title of a slide\'s definition box |\\n| box-notice-title
| optional, content, default: [Notice]
, shown as the title of a slide\'s notice box |\\n| box-example-title
| optional, content, default: [Example]
, shown as the title of a slide\'s example box |\\n| date
| optional, datetime, default: datetime.today()
|\\n| show-todolist
| optional, bool, default: true
, show list of usages of the todo
function after the outline |\\n| show-title-slide
| optional, bool, default: true
, show title slide |\\n| show-author
| optional, bool, default: true
, show author name on title slide |\\n| show-footer
| optional, bool, default: true
, show footer on slides |\\n| show-page-numbers
| optional, bool, default: true
, show page numbering |\\n| outline-title-text
| optional, content, default: \\"Outline\\"
, title for the outline |\\n| body
| content, document content |
slide
, pause
, only
, uncover
: imported from polyluxThe following functions can be imported from slides
, exercise
and seminar-paper
:
todo(content, ...)
- create a highlighted inline todo-notelist-todos()
- create list of all todo-usages with page of usage and contenthide-todos()
- hides all usages of todo()
in the documentThe following functions can be imported from slides
, exercise
and seminar-paper
: definition
New:
\\ntodo
, list-todos
, hide-todos
in todo.typ
, importable from slides
, exercise.project
and seminar-paper.project
show-todolist
attribute in above templatesignore-points
attribute in task
and subtask
of exercises, so that their points won\'t be shown in the solution matrix or point distributionshow-solution-matrix-comment-field
and solution-matrix-comment-field-value
options in exercise.project
type
in slides.task
sllides.slides
:\\nhead-replacement
title-replacement
footer
page-numbering
show-title-slide
show-author
(on title slide)show-date
show-footer
show-page-numbers
show-outline
in seminar-paper.project
Changes:
\\ndates.typ
becomes german-dates.typ
Fixes:
\\nBreaking Changes:
\\ndates
becomes german-dates
with-outline
to show-outline
A CeTZ library for drawing simple two- or three-set Venn diagrams.
\\n\\n \\n ![]() | \\n \\n \\n ![]() | \\n
Two set Venn diagram | \\nThree set Venn diagram | \\n
Click on the example image to jump to the code.
\\nThis package requires CeTZ version >= 0.3.1!
\\nFor information, see the manual (stable).
\\nTo use this package, simply add the following code to your document:
\\n#import \\"@preview/cetz:0.3.1\\"\\n#import \\"@preview/cetz-venn:0.1.1\\"\\n\\n#cetz.canvas({\\n cetz-venn.venn2()\\n})\\n
\\n","description":"A CeTZ library for drawing simple two- or three-set Venn diagrams. Examples\\n\\t \\n Two set Venn diagram\\t Three set Venn diagram\\n\\nClick on the example image to jump to the code.\\n\\nUsage\\n\\nThis package requires CeTZ version >= 0.3.1!\\n\\nFor…","guid":"https://typst.app/universe/package/cetz-venn","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-19T06:43:48.545Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz-venn/0.1.2/gallery/venn2.png","type":"photo","width":329,"height":258,"blurhash":"LaRoy.v#%$uOxujZj]f+*0cEI9q]"},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz-venn/0.1.2/gallery/venn3.png","type":"photo","width":469,"height":454,"blurhash":"LWQJcc=g~qPm$vr]SkOp_NOn9G#X"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"sunny-famnit (0.2.0) | Thesis template for University of Primorska, FAMNIT","url":"https://typst.app/universe/package/sunny-famnit","content":"\\n
University of Primorska,
\\nFaculty of Mathematics, Natural Sciences and Information Technologies
\\nThis is a Typst template for FAMNIT final work.
\\n#import \\"@preview/sunny-famnit:0.2.0\\": project\\n\\n#show project.with(\\ndate: datetime(day: 1, month: 1, year: 2024), // you could also do `datetime.today()`\\ntext_lang: \\"en\\" // the language that the thesis is gonna be written in.\\n\\nauthor: \\"your name\\"\\nstudij: \\"your course\\",\\nmentor: (\\n name: \\"his name\\", \\n en: (\\"prepends\\",\\"postpends\\"), // you can prepend or postpend any titles\\n sl: (\\"predstavki\\",\\"postavki\\"),// you can prepend or postpend any titles\\n ),\\nsomentor: none, // if you have a co-mentor write him here the same way as mentor, else you can just remove the line.\\nwork_mentor: none, // if you have a work mentor, the same as above\\n\\nnaslov: \\"your title in slovene\\",\\ntitle: \\"your title\\",\\n\\nizvleček: [\\nyour abstract in slovene.\\n],\\nabstract: [\\nyour abstract\\n],\\n\\nključne_besede: (\\"Typst\\", \\"je\\", \\"super!\\"),\\nkey_words: (\\"Typst\\", \\"is\\", \\"Awesome!\\"),\\n\\nkratice: (\\n\\"Famnit\\": \\"Fakulteta za matematiko naravoslovje in informacijske tehnologije\\",\\n\\"PDF\\": \\"Portable document format\\",\\n),\\n\\npriloge: (), // you can add attachments as a dict of a title and content like `\\"name\\": [content],`\\n\\nzahvala: [\\nyou can add an acknowlegment.\\n],\\n\\n bib_file: bibliography(\\n \\"my_references.bib\\",\\n style: \\"ieee\\",\\n title: [Bibliography],\\n ),\\n\\n/* Additional content and their defaults\\n kraj: \\"Koper\\",\\n*/\\n)\\n\\n// Your content goes below.\\n\\n
\\nYou can specify Abbreviations at the start as an attribute kratice
and pass it a dictionary of the abbriviation and it\'s explanation.\\nThen you can reference them in text using @<short name>
to create a link to it.
Some thesis need Attachments that are shown at the end of the file.\\nTo add these attachments add them in your project under priloge
as a dictionary of the attachment name and its content.\\nI suggest having a seperate attachments.typ
file, from where you can reference them in the main project.
The writing of the thesis can be achieved in two languages; Slovene and English.\\nThey have some differences between them in the way the template is generated, as the thesis needs to be different for each one.\\nyou can specify the language with the text_lang
attribute.
If you have any questions, suggestion or improvements open an issue or a pull request here
\\n","description":"University of Primorska, Faculty of Mathematics, Natural Sciences and Information Technologies\\n\\nThis is a Typst template for FAMNIT final work.\\n\\nconfiguration example\\n#import \\"@preview/sunny-famnit:0.2.0\\": project\\n\\n#show project.with(\\ndate: datetime(day: 1, month: 1, year…","guid":"https://typst.app/universe/package/sunny-famnit","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-19T06:43:27.630Z","media":[{"url":"https://img.shields.io/github/v/release/Tiggax/famnit_typst_template","type":"photo","width":94,"height":20},{"url":"https://img.shields.io/github/stars/Tiggax/famnit_typst_template","type":"photo","width":76,"height":20},{"url":"https://www.famnit.upr.si/img/UP_FAMNIT.png","type":"photo","width":202,"height":107}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"scholarly-epfl-thesis (0.1.1) | A template for a thesis at EPFL","url":"https://typst.app/universe/package/scholarly-epfl-thesis","content":"Adaptation of an unofficial LaTeX template to Typst.
\\nA complete example is shown in the example folder; see example.pdf for the rendered PDF. The document structure can of course be adapted to your needs.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the dashboard and searching for epfl
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/scholarly-epfl-thesis\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template uses certain fonts, including Utopia Latex for most text. If the font is not available to Typst, as is the case in the Typst Web App, then the template will fall back to a default font. The font is included in example shown in the Github repository here, otherwise you can download it however you like.
\\nThis template exports the template
function with the following named arguments:
title
: The work\'s title. Default: [Your Title]
author
: The author\'s name. Default: \\"Your Name\\"
paper-size
: The work\'s paper size. Default: \\"a4\\"
date
: The work\'s date. Unused for now. Default: none
date-format
: The format for displaying the work\'s date. By default, the date will be displayed as MMMM DD, YYYY
. Unused for now. Default: [month repr:long] [day padding:zero], [year repr:full]
The template will initialize your package with a basic call to the template
function in a show
rule. If you, however, want to change an existing project to use this template, you can add a show rule like this at the top of your file:
#import \\"@preview/scholarly-epfl-thesis:0.1.1\\": *\\n\\n#show: template.with(\\n title: [Your Title],\\n author: \\"Your Name\\",\\n date: datetime(year: 2024, month: 03, day: 19),\\n)\\n\\n// Your content goes below.\\n
\\nAlso included are the front-matter
, main-matter
and back-matter
helpers which you can use in show
rules in your document to change certain settings when they are called: e.g. reset the page numbering when main matter starts, or number headings with letters in the back matter.\\nSee example/main.typ for example usage.
In order for Typst to access the Utopia Latex font, you need to include it your font path. I\'ve included the font in example/
so that you can run this in your shell:
cd example\\ntypst w main.typ --font-path .\\n
\\nSee here for more about the font path.
\\nshow heading.where(level: 1)
it disrupts the outline. I guess it would work if you put in the metadata
manually before each chapter.outline.entry
can\'t be modified easily because the arguments are positional\\nlink
manually but that gets formatted like a link in the text, which is not what we\'re looking for.\\nkind
mechanic, but I can\'t get the superfigure\'s caption centeredfront-matter
, main-matter
...pad
work and not h
?\\n \\n \\n \\n \\n
\\n \\n
\\n
Codly is a package that lets you easily create beautiful code blocks for your Typst documents.\\nIt uses the newly added raw.line
\\nfunction to work across all languages easily. You can customize the icons, colors, and more to\\nsuit your document\'s theme. By default it has zebra striping, line numbers, for ease of reading.
A full set of documentation can be found in the repo.
\\n#import \\"@preview/codly:1.0.0\\": *\\n#show: codly-init.with()\\n\\n#codly(\\n languages: (\\n rust: (\\n name: \\"Rust\\",\\n icon: text(font: \\"tabler-icons\\", \\"\\\\u{fa53}),\\n color: rgb(\\"#CE412B\\")\\n ),\\n )\\n)\\n\\n```rust\\npub fn main() {\\n println!(\\"Hello, world!\\");\\n}\\n```\\n
\\nTo start using codly, you need to initialize codly using a show rule:
\\n#show: codly-init.with()\\n
\\n\\n\\n[!TIP]\\nYou only need to do this once at the top of your document!
\\n
Then you can to configure codly with your parameters:
\\n#codly(\\n languages: (\\n rust: (name: \\"Rust\\", icon: \\"\\\\u{fa53}\\", color: rgb(\\"#CE412B\\")),\\n )\\n)\\n
\\n\\n\\n[!IMPORTANT]\\nAny parameter that you leave blank will use the previous values (or the default value if never set) similar to a
\\nset
rule in regular typst. But the changes are always global unless you use the providedcodly.local
function. To get a full list of all settings, see the documentation.
Then you just need to add a code block and it will be automatically displayed correctly:
\\n```rust\\npub fn main() {\\n println!(\\"Hello, world!\\");\\n}\\n```\\n
\\nTo locally disable codly, you can just do the following, you can then later re-enable it using the codly
configuration function.
#disable-codly()\\n
\\nAlternatively, you can use the no-codly
function to achieve the same effect locally:
#no-codly[\\n ```typ\\n I will be displayed using the normal raw blocks.\\n ```\\n]\\n
\\nIf you wish to add an offset to your code block, but without selecting a subset of lines, you can use the codly-offset
function:
// Sets a 5 line offset\\n#codly-offset(5)\\n
\\nIf you wish to select a subset of lines, you can use the codly-range
function. By setting the start to 1 and the end to none
you can select all lines from the start to the end of the code block.
#codly-range(start: 5, end: 10)\\n
\\nYou can add a \\"fake\\" skip between lines using the skips
parameters:
// Before the 5th line (indexing start at 0), insert a 32 line jump.\\n#codly(skips: ((4, 32), ))\\n
\\nThis can be customized using the skip-line
and skip-number
to customize what it looks like.
\\n\\n[!IMPORTANT]\\nThis is a Beta feature and has a few quirks, refer to the documentation for those
\\n
You can annotate a line/group of lines using the annotations
parameters :
// Add an annotation from the second line (0 indexing) to the 5th line included.\\n#codly(\\n annotations: (\\n (\\n start: 1,\\n end: 4,\\n content: block(\\n width: 2em,\\n // Rotate the element to make it look nice\\n rotate(\\n -90deg,\\n align(center, box(width: 100pt)[Function body])\\n )\\n )\\n ), \\n )\\n)\\n
\\nYou can configure this with the codly
function:
#codly(number-format: none)\\n
\\nYou disable zebra striping by setting the zebra-fill
to white.
#codly(zebra-fill: none)\\n
\\nYou can customize the stroke surrounding the figure using the stroke
parameter of the codly
function:
#codly(stroke: 1pt + red)\\n
\\nYou can also disable the icon, by setting the display-icon
parameter to false
:
#codly(display-icon: false)\\n
\\nSame with the name, whether the block is breakable, the radius, the padding, and the width of the numbers columns, and so many more documentation.
\\n","description":"Codly is a package that lets you easily create beautiful code blocks for your Typst documents. It uses the newly added raw.line function to work across all languages easily. You can customize the icons, colors, and more to suit your document\'s theme…","guid":"https://typst.app/universe/package/codly","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-17T08:12:56.585Z","media":[{"url":"https://img.shields.io/website?down_message=offline&label=manual&up_color=007aff&up_message=online&url=https%3A%2F%2Fgithub.com%2FDherse%2Fcodly%2Fblob%2Fmain%2Fdocs.pdf","type":"photo","width":94,"height":20},{"url":"https://img.shields.io/badge/license-MIT-brightgreen","type":"photo","width":78,"height":20},{"url":"https://github.com/Dherse/codly/actions/workflows/test.yml/badge.svg","type":"photo","width":100,"height":20},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/codly/1.0.0/demo.png","type":"photo","width":833,"height":163}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"graceful-genetics (0.2.0) | A paper template with which to publish in journals and at conferences","url":"https://typst.app/universe/package/graceful-genetics","content":"graceful-genetics
PackageA recreation of the Oxford Physics template shown on the typst.app homepage.
\\n\\n \\n \\n
\\n
To use this template, simply import it as shown below:
\\n#import \\"@preview/graceful-genetics:0.2.0\\"\\n\\n#show: graceful-genetics.template.with(\\n title: [Towards Swifter Interstellar Mail Delivery],\\n authors: (\\n (\\n name: \\"Johanna Swift\\",\\n department: \\"Primary Logistics Department\\",\\n institution: \\"Delivery Institute\\",\\n city: \\"Berlin\\",\\n country: \\"Germany\\",\\n mail: \\"swift@delivery.de\\",\\n ),\\n (\\n name: \\"Egon Stellaris\\",\\n department: \\"Communications Group\\",\\n institution: \\"Space Institute\\",\\n city: \\"Florence\\",\\n country: \\"Italy\\",\\n mail: \\"stegonaris@space.it\\",\\n ),\\n (\\n name: \\"Oliver Liam\\",\\n department: \\"Missing Letters Task Force\\",\\n institution: \\"Mail Institute\\",\\n city: \\"Budapest\\",\\n country: \\"Hungary\\",\\n mail: \\"oliver.liam@mail.hu\\",\\n ),\\n ),\\n date: (\\n year: 2022,\\n month: \\"May\\",\\n day: 17,\\n ),\\n keywords: (\\n \\"Space\\",\\n \\"Mail\\",\\n \\"Astromail\\",\\n \\"Faster-than-Light\\",\\n \\"Mars\\",\\n ),\\n doi: \\"10:7891/120948510\\",\\n abstract: [\\n Recent advances in space-based document processing have enabled faster mail delivery between different planets of a solar system. Given the time it takes for a message to be transmitted from one planet to the next, its estimated that even a one-way trip to a distant destination could take up to one year. During these periods of interplanetary mail delivery there is a slight possibility of mail being lost in transit. This issue is considered so serious that space management employs P.I. agents to track down and retrieve lost mail. We propose A-Mail, a new anti-matter based approach that can ensure that mail loss occurring during interplanetary transit is unobservable and therefore potentially undetectable. Going even further, we extend A-Mail to predict problems and apply existing and new best practices to ensure the mail is delivered without any issues. We call this extension AI-Mail.\\n ]\\n)\\n
\\n","description":"Version 0.2.0 A recreation of the Oxford Physics template shown on the typst.app homepage.\\n\\nMedia\\n\\n \\n\\nGetting Started\\n\\nTo use this template, simply import it as shown below:\\n\\n#import \\"@preview/graceful-genetics:0.2.0\\"\\n\\n#show: graceful-genetics.template.with(\\n title…","guid":"https://typst.app/universe/package/graceful-genetics","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-16T20:49:00.799Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/graceful-genetics/0.2.0/thumbnails/1.png","type":"photo","width":1191,"height":1684,"blurhash":"LCRfkCogxu_3~qD%IUozxuM{M{oL"},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/graceful-genetics/0.2.0/thumbnails/2.png","type":"photo","width":1191,"height":1684,"blurhash":"LGSs50RjW;~q%MM{jZt7%Mxun%V@"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"splendid-mdpi (0.1.0) | An MDPI-style paper template to publish at conferences and journals","url":"https://typst.app/universe/package/splendid-mdpi","content":"splendid-mdpi
PackageA recreation of the MDPI template shown on the typst.app homepage.
\\n\\n \\n \\n
\\n
To use this template, simply import it as shown below:
\\n#import \\"@preview/splendid-mdpi:0.1.0\\"\\n\\n#show: splendid-mdpi.template.with(\\n title: [Towards Swifter Interstellar Mail Delivery],\\n authors: (\\n (\\n name: \\"Johanna Swift\\",\\n department: \\"Primary Logistics Department\\",\\n institution: \\"Delivery Institute\\",\\n city: \\"Berlin\\",\\n country: \\"Germany\\",\\n mail: \\"swift@delivery.de\\",\\n ),\\n (\\n name: \\"Egon Stellaris\\",\\n department: \\"Communications Group\\",\\n institution: \\"Space Institute\\",\\n city: \\"Florence\\",\\n country: \\"Italy\\",\\n mail: \\"stegonaris@space.it\\",\\n ),\\n (\\n name: \\"Oliver Liam\\",\\n department: \\"Missing Letters Task Force\\",\\n institution: \\"Mail Institute\\",\\n city: \\"Budapest\\",\\n country: \\"Hungary\\",\\n mail: \\"oliver.liam@mail.hu\\",\\n ),\\n ),\\n date: (\\n year: 2022,\\n month: \\"May\\",\\n day: 17,\\n ),\\n keywords: (\\n \\"Space\\",\\n \\"Mail\\",\\n \\"Astromail\\",\\n \\"Faster-than-Light\\",\\n \\"Mars\\",\\n ),\\n doi: \\"10:7891/120948510\\",\\n abstract: [\\n Recent advances in space-based document processing have enabled faster mail delivery between different planets of a solar system. Given the time it takes for a message to be transmitted from one planet to the next, its estimated that even a one-way trip to a distant destination could take up to one year. During these periods of interplanetary mail delivery there is a slight possibility of mail being lost in transit. This issue is considered so serious that space management employs P.I. agents to track down and retrieve lost mail. We propose A-Mail, a new anti-matter based approach that can ensure that mail loss occurring during interplanetary transit is unobservable and therefore potentially undetectable. Going even further, we extend A-Mail to predict problems and apply existing and new best practices to ensure the mail is delivered without any issues. We call this extension AI-Mail.\\n ]\\n)\\n
\\n","description":"Version 0.1.0 A recreation of the MDPI template shown on the typst.app homepage.\\n\\nMedia\\n\\n \\n\\nGetting Started\\n\\nTo use this template, simply import it as shown below:\\n\\n#import \\"@preview/splendid-mdpi:0.1.0\\"\\n\\n#show: splendid-mdpi.template.with(\\n title: [Towards Swifter…","guid":"https://typst.app/universe/package/splendid-mdpi","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-16T20:48:44.424Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/splendid-mdpi/0.1.0/thumbnails/1.png","type":"photo","width":1191,"height":1684},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/splendid-mdpi/0.1.0/thumbnails/2.png","type":"photo","width":1191,"height":1684}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"neoplot (0.0.2) | Gnuplot in Typst","url":"https://typst.app/universe/package/neoplot","content":"A Typst package to use gnuplot in Typst.
\\n#import \\"@preview/neoplot:0.0.2\\" as gp\\n
\\nExecute gnuplot commands:
\\n#gp.exec(\\n kind: \\"command\\",\\n ```gnuplot\\n reset;\\n set samples 1000;\\n plot sin(x),\\n cos(x)\\n ```\\n)\\n
\\nExecute a gnuplot script:
\\n#gp.exec(\\n ```gnuplot\\n reset\\n # Can add comments since it is a script\\n set samples 1000\\n # Use a backslash to extend commands\\n plot sin(x), \\\\\\n cos(x)\\n ```\\n)\\n
\\nTo read a data file:
\\n# datafile.dat\\n# x y\\n 0 0\\n 2 4\\n 4 0\\n
\\n#gp.exec(\\n ```gnuplot\\n $data <<EOD\\n 0 0\\n 2 4\\n 4 0\\n EOD\\n plot $data with linespoints\\n ```\\n)\\n
\\nor
\\n#gp.exec(\\n // Use a datablock since Typst doesn\'t support WASI\\n \\"$data <<EOD\\\\n\\" +\\n // Load \\"datafile.dat\\" using Typst\\n read(\\"datafile.dat\\") +\\n \\"EOD\\\\n\\" +\\n \\"plot $data with linespoints\\"\\n)\\n
\\nTo print $data
:
#gp.exec(\\"print $data\\")\\n
\\n","description":"A Typst package to use gnuplot in Typst. #import \\"@preview/neoplot:0.0.2\\" as gp\\n\\n\\nExecute gnuplot commands:\\n\\n#gp.exec(\\n kind: \\"command\\",\\n ```gnuplot\\n reset;\\n set samples 1000;\\n plot sin(x),\\n cos(x)\\n ```\\n)\\n\\n\\nExecute a gnuplot script:\\n\\n#gp.exec…","guid":"https://typst.app/universe/package/neoplot","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-16T14:57:57.475Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"springer-spaniel (0.1.0) | A loose recreation of the Springer Contributed Chapter template on Overleaf","url":"https://typst.app/universe/package/springer-spaniel","content":"springer-spaniel
PackageThis is an loose recreation of the Springer Contributed Chapter LaTeX template on Overleaf. It aims to provide template-level support for commonly used packages so you don\'t have to choose between style and features.
\\n\\n \\n
\\n
\\n
These instructions will get you a copy of the project up and running on the typst web app. Perhaps a short code example on importing the package and a very simple teaser usage.
\\n#import \\"@preview/springer-spaniel:0.1.0\\"\\n#import springer-spaniel.ctheorems: * // provides \\"proof\\", \\"theorem\\", \\"lemma\\"\\n\\n#show: springer-spaniel.template(\\n title: [Contribution Title],\\n authors: (\\n (\\n name: \\"Name of First Author\\",\\n institute: \\"Name\\",\\n address: \\"Address of Institute\\",\\n email: \\"name@email.address\\"\\n ),\\n // ... and so on\\n ),\\n abstract: lorem(75),\\n\\n // debug: true, // Highlights structural elements and links\\n // frame: 1pt, // A border around the page for white on white display\\n // printer-test: true, // Suitably placed CMYK printer tests\\n)\\n\\n= Section Heading\\n== Subsection Heading\\n=== Subsubsection Heading\\n==== Paragraph Heading\\n===== Subparagraph Heading\\n
\\nTo install this project locally, follow the steps below;
\\njust install-preview
simplebnf is a simple package to format Backus-Naur form. The package provides a simple way to format Backus-Naur form (BNF). It provides constructs to denote BNF expressions, possibly with annotations.
\\nThis is a sister package of simplebnf, a LaTeX package under the same name by the author.
\\nImport simplebnf via
\\n#import \\"@preview/simplebnf:0.1.1\\": *\\n
\\nUse the bnf
function to display the BNF production rules. Each production rule can be created using the Prod
constructor function, which accepts the (left-hand side) metavariable, an optional annotation for it, an optional delimiter (which defaults to ⩴), and a list of (right-hand side) alternatives. Each alternative should be created using the Or
constructor, which accepts a syntactic form and an annotation.
Below are some examples using simplebnf.
\\n#bnf(\\n Prod(\\n $e$,\\n annot: $sans(\\"Expr\\")$,\\n {\\n Or[$x$][_variable_]\\n Or[$λ x. e$][_abstraction_]\\n Or[$e$ $e$][_application_]\\n },\\n ),\\n)\\n
\\n#bnf(\\n Prod(\\n $e$,\\n delim: $→$,\\n {\\n Or[$x$][variable]\\n Or[$λ x: τ.e$][abstraction]\\n Or[$e space e$][application]\\n Or[$λ τ.e space e$][type abstraction]\\n Or[$e space [τ]$][type application]\\n },\\n ),\\n Prod(\\n $τ$,\\n delim: $→$,\\n {\\n Or[$X$][type variable]\\n Or[$τ → τ$][type of functions]\\n Or[$∀X.τ$][universal quantification]\\n },\\n ),\\n)\\n
\\nsimplebnf.typ is available under the MIT license. See the LICENSE file for more info.
\\n","description":"simplebnf is a simple package to format Backus-Naur form. The package provides a simple way to format Backus-Naur form (BNF). It provides constructs to denote BNF expressions, possibly with annotations. This is a sister package of simplebnf, a LaTeX package under the same name…","guid":"https://typst.app/universe/package/simplebnf","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-15T11:45:36.666Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/simplebnf/0.1.1/examples/lambda.svg","type":"photo","width":211,"height":87},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/simplebnf/0.1.1/examples/system-f.svg","type":"photo","width":284,"height":171}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"valkyrie (0.2.1) | Type safe type validation","url":"https://typst.app/universe/package/valkyrie","content":"Valkyrie
PackageThis package implements type validation, and is targeted mainly at package and template developers. The desired outcome is that it becomes easier for the programmer to quickly put a package together without spending a long time on type safety, but also to make the usage of those packages by end-users less painful by generating useful error messages.
\\n#import \\"@preview/valkyrie:0.2.1\\" as z\\n\\n#let my-schema = z.dictionary((\\n should-be-string: z.string(),\\n complicated-tuple: z.tuple(\\n z.email(),\\n z.ip(),\\n z.either(\\n z.string(),\\n z.number(),\\n ),\\n ),\\n )\\n)\\n\\n#z.parse(\\n (\\n should-be-string: \\"This doesn\'t error\\",\\n complicated-tuple: (\\n \\"neither@does-this.com\\",\\n // Error: Schema validation failed on argument.complicated-tuple.1: \\n // String must be a valid IP address\\n \\"NOT AN IP\\",\\n 1,\\n ),\\n ),\\n my-schema,\\n)\\n
\\nAs of version 0.2.0, valkyrie
now resides in the typst-community organisation. Typst users are encouraged to submit additional types, assertions, coercions, and schemas that they believe are already used widely, or should be widely adopted for the health of the ecosystem.
This package helps extracting metadata for preprocessing from a typst document, for example image URLs for download from the web. Typst compilations are sandboxed: it is not possible for Typst packages, or even just a Typst document itself, to access the \\"ouside world\\". This sandboxing of Typst has good reasons. Yet, it is often convenient to trade a bit of security for convenience by weakening it. Prequery helps with that by providing some simple scaffolding for supporting preprocessing of documents.
\\nHere\'s an example for referencing images from the internet:
\\n#import \\"@preview/prequery:0.1.0\\"\\n\\n// toggle this comment or pass `--input prequery-fallback=true` to enable fallback\\n// #prequery.fallback.update(true)\\n\\n#prequery.image(\\n \\"https://en.wikipedia.org/static/images/icons/wikipedia.png\\",\\n \\"assets/wikipedia.png\\")\\n
\\nUsing typst query
, the image URL(s) are extracted from the document:
typst query --input prequery-fallback=true --field value \\\\\\n main.typ \'<web-resource>\'\\n
\\nThis will output the following piece of JSON:
\\n[{\\"url\\": \\"https://en.wikipedia.org/static/images/icons/wikipedia.png\\", \\"path\\": \\"assets/wikipedia.png\\"}]\\n
\\nWhich can then be used to download all images to the expected locations.
\\nSee the manual for details.
\\n","description":"This package helps extracting metadata for preprocessing from a typst document, for example image URLs for download from the web. Typst compilations are sandboxed: it is not possible for Typst packages, or even just a Typst document itself, to access the \\"ouside world\\". This…","guid":"https://typst.app/universe/package/prequery","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-15T11:27:04.712Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"stack-pointer (0.1.0) | A library for visualizing the execution of (imperative) computer programs","url":"https://typst.app/universe/package/stack-pointer","content":"Stack Pointer is a library for visualizing the execution of (imperative) computer programs, particularly in terms of effects on the call stack: stack frames and local variables therein.
\\nStack Pointer lets you represent an example program (e.g. a C or Java program) using typst code with minimal hassle, and get the execution state of that program at different points in time. For example, the following C program
\\nint main() {\\n int x = foo();\\n return 0;\\n}\\n\\nint foo() {\\n return 0;\\n}\\n
\\nwould be represented by the following Typst code (see the manual for a detailled explanation):
\\n#let steps = execute({\\n let foo() = func(\\"foo\\", 6, l => {\\n l(0)\\n l(1); retval(0)\\n })\\n let main() = func(\\"main\\", 1, l => {\\n l(0)\\n l(1)\\n let (x, ..rest) = foo(); rest\\n l(1, push(\\"x\\", x))\\n l(2)\\n })\\n main(); l(none)\\n})\\n
\\nThe steps
variable now contains an array, where each element corresponds to one of the mentioned lines of code.
Take a look at this complete example of using Stack Pointer together with Polylux.
\\n","description":"Stack Pointer is a library for visualizing the execution of (imperative) computer programs, particularly in terms of effects on the call stack: stack frames and local variables therein. Stack Pointer lets you represent an example program (e.g. a C or Java program) using typst…","guid":"https://typst.app/universe/package/stack-pointer","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-15T11:27:04.523Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"scrutinize (0.3.0) | A library for building exams, tests, etc. with Typst","url":"https://typst.app/universe/package/scrutinize","content":"Scrutinize is a library for building exams, tests, etc. with Typst.\\nIt has three general areas of focus:
\\nRight now, providing a styled template is not part of this package\'s scope.\\nAlso, visual customization of the provided question templates is currently nonexistent.
\\nSee the manual for details.
\\n\\n \\n ![]() | \\n \\n \\n ![]() | \\n
This example can be found in the gallery. Here are some excerpts from it:
\\n#import \\"@preview/scrutinize:0.3.0\\" as scrutinize: grading, task, solution, task-kinds\\n#import task-kinds: free-form, gap, choice\\n#import task: t\\n\\n// ... document setup ...\\n\\n#context {\\n let ts = task.all(level: 2)\\n let total = grading.total-points(ts)\\n\\n let grades = grading.grades(\\n [F],\\n 0.6 * total,\\n [D],\\n 0.7 * total,\\n [C],\\n 0.8 * total,\\n [B],\\n 0.9 * total,\\n [A],\\n )\\n\\n // ... show the grading key ...\\n}\\n\\n// ...\\n\\n= Basic competencies -- theoretical part B\\n\\n#lorem(40)\\n\\n== Writing\\n#t(category: \\"b\\", points: 4)\\n#lorem(30)\\n\\n#free-form.lines(stretch: 180%, lorem(20))\\n\\n== Multiple Choice\\n#t(category: \\"b\\", points: 2)\\n#lorem(30)\\n\\n#{\\n set align(center)\\n choice.multiple((\\n (lorem(3), true),\\n (lorem(5), true),\\n (lorem(4), false),\\n ))\\n}\\n
\\n","description":"Scrutinize is a library for building exams, tests, etc. with Typst. It has three general areas of focus: It helps with grading information: record the points that can be reached for each question and make them available for creating grading keys.\\nIt provides a selection of…","guid":"https://typst.app/universe/package/scrutinize","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-15T11:27:04.393Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/scrutinize/0.3.0/thumbnail.png","type":"photo","width":2067,"height":2923,"blurhash":"LCS6Pl%M%M_3~qofWBj[%Mt7WBWB"},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/scrutinize/0.3.0/thumbnail-solved.png","type":"photo","width":2067,"height":2923,"blurhash":"LDR{#?%3%M_2~qt7WBj[x[t7R*WB"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"crudo (0.1.1) | Take slices from raw blocks","url":"https://typst.app/universe/package/crudo","content":"Crudo allows conveniently working with raw
blocks in terms of individual lines. It allows you to e.g.
While transforming the content, the original parameters specified on the given raw block will be preserved.
\\nThe full version of this example can be found in gallery/thumbnail.typ.
\\nFrom\\n\\n#let preamble = ```typ\\n#import \\"@preview/crudo:0.1.0\\"\\n\\n```\\n#preamble\\n\\nand\\n\\n#let example = ````typ\\n#crudo.r2l(```c\\nint main() {\\n return 0;\\n}\\n```)\\n````\\n#example\\n\\nwe get\\n\\n#let full-example = crudo.join(preamble, example)\\n#full-example\\n\\nIf you execute that, you get\\n\\n#eval(full-example.text, mode: \\"markup\\")\\n
\\nSee the manual for details.
\\n","description":"Crudo allows conveniently working with raw blocks in terms of individual lines. It allows you to e.g. filter lines by content\\nfilter lines by range (slicing)\\ntransform lines\\njoin multiple raw blocks\\n\\nWhile transforming the content, the original parameters specified on the given…","guid":"https://typst.app/universe/package/crudo","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-15T11:27:04.119Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/crudo/0.1.1/thumbnail.png","type":"photo","width":984,"height":1408,"blurhash":"LASPX_?bRR~q_3t7Rjj?xuWVWUkB"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"dvdtyp (1.0.0) | a colorful template for writting handouts or notes","url":"https://typst.app/universe/package/dvdtyp","content":"A colorful template for writting handouts or notes
\\nfletcher (noun) a maker of arrows
\\nA Typst package for drawing diagrams with arrows,\\nbuilt on top of CeTZ.\\nSee the manual for documentation.
\\n#import \\"@preview/fletcher:0.5.2\\" as fletcher: diagram, node, edge\\n
\\n#diagram(cell-size: 15mm, $\\n G edge(f, ->) edge(\\"d\\", pi, ->>) & im(f) \\\\\\n G slash ker(f) edge(\\"ur\\", tilde(f), \\"hook--\x3e\\")\\n$)\\n
\\n// https://xkcd.com/1195/\\n#import fletcher.shapes: diamond\\n#set text(font: \\"Comic Neue\\", weight: 600)\\n\\n#diagram(\\n node-stroke: 1pt,\\n edge-stroke: 1pt,\\n node((0,0), [Start], corner-radius: 2pt, extrude: (0, 3)),\\n edge(\\"-|>\\"),\\n node((0,1), align(center)[\\n Hey, wait,\\\\ this flowchart\\\\ is a trap!\\n ], shape: diamond),\\n edge(\\"d,r,u,l\\", \\"-|>\\", [Yes], label-pos: 0.1)\\n)\\n
\\n#set text(10pt)\\n#diagram(\\n node-stroke: .1em,\\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\\n spacing: 4em,\\n edge((-1,0), \\"r\\", \\"-|>\\", `open(path)`, label-pos: 0, label-side: center),\\n node((0,0), `reading`, radius: 2em),\\n edge(`read()`, \\"-|>\\"),\\n node((1,0), `eof`, radius: 2em),\\n edge(`close()`, \\"-|>\\"),\\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\\n edge((0,0), (0,0), `read()`, \\"--|>\\", bend: 130deg),\\n edge((0,0), (2,0), `close()`, \\"-|>\\", bend: -40deg),\\n)\\n
\\n#diagram($\\n e^- edge(\\"rd\\", \\"-<|-\\") & & & edge(\\"ld\\", \\"-|>-\\") e^+ \\\\\\n & edge(gamma, \\"wave\\") \\\\\\n e^+ edge(\\"ru\\", \\"-|>-\\") & & & edge(\\"lu\\", \\"-<|-\\") e^- \\\\\\n$)\\n
\\nPull requests are most welcome!
\\n\\n \\n \\n | \\n \\n \\n \\n | \\n
\\n \\n \\n | \\n \\n \\n \\n | \\n
\\n \\n \\n | \\n \\n \\n \\n | \\n
\\n \\n \\n | \\n
typst
version >=0.12.0
.cetz
dependency to 0.3.1
. Note: This may slightly change edge label positions.loop-angle
option to edge()
(#36).enclose
absolute coordinates.enclose
option.edge(\\"r,r\\")
or edge(\\"r,l\\")
) and enhance the way the corner radius adapts to the bend angle. Note: This may change diagram layout from previous versions.n
(many), n?
(zero or more), n!
(one or more), 1
(one), 1?
(zero or one), 1!
(exactly one).node-shape
option to diagram()
.label-angle
option to edge()
.label-wrapper
option to allow changing the label inset, outline stroke, and so on (#26).label-size
option to control default edge label text size (#35)trapezium
node shape.edge()
(to eliminate ambiguity). Used named argument or pass content instead.fit
and dir
options to various node shapes to adjust sizing and orientation.snap-to
to be none
to disable edge snapping (#32).enclose
option of node()
.align()
.layer
option to nodes and edges to control drawing order.ellipse
, octagon
.fletcher.hide()
to hide elements with/without affecting layout, useful for incremental diagrams in slides (#15).shift
ing edges by coordinate deltas as well as absolute lengths (#13).snap-to
option to edge()
.inset
being half the amount specified. If upgrading from previous version, you will need to divide node inset
values by two to preserve diagram layout.decorations
option to edge()
for CeTZ path decorations (\\"wave\\"
, \\"zigzag\\"
, and \\"coil\\"
, also accepted as positional string arguments).shapes
submodule, containing diamond
, pill
, parallelogram
, hexagon
, and other node shapes.vertices
an corner-radius
options to edge()
.\\"r,u,ll\\"
.dodge
option to edge()
to adjust end points.cetz:0.2.0
.&
to separate nodes.edge(\\"d\\")
becomes edge(prev-node, (0, 1))
.|->-|
and hook-/->>
.}>
, <{
, /
, \\\\
, x
, X
, *
(solid dot), @
(solid circle).axes
option to diagram()
to control the direction of each axis in the diagram\'s coordinate system.width
, height
and radius
options to node()
for explicit control over size.corner-radius
option to node()
.stroke
option to edge()
replacing thickness
and paint
options.edge-stroke
option to diagram()
replacing edge-thickness
.<|-
, -|>
and double-bar ||-
, -||
.extrude
option to node()
which duplicates and extrudes the node\'s stroke, enabling double stroke effects.edge(..., corner: left/right)
.A package to write song lyrics with chord diagrams in Typst.
\\nTable of Contents
\\nWith chordx
you can easily generate song lyrics with chords for writing songbooks.
chordx
generates chord charts for stringed instruments (e.g. guitar, ukulele, etc.), piano chords (with diferent piano layouts) and single chords that are chords without charts used to write the chords over a word to write songbooks.
chordx
exports 3 functions to generate diferents types fo charts:
chart-chord
: used to generate chart chords for stringed instruments.piano-chord
: used to generate piano chords.single-chord
: used to show the chord name over a word.Typst added an experimental package repository and you can import chordx
as follows:
#import \\"@preview/chordx:0.4.0\\": *\\n
\\nIf the package hasn\'t been released yet, or if you just want to use it from this repository, you can use local-packages.
\\nYou can read the documentation about typst local-packages and learn about the path folders used in differents operating systems (Linux / MacOS / Windows).
\\nIn Linux you can do:
\\ngit clone https://github.com/ljgago/typst-chords ~/.local/share/typst/packages/local/chordx/0.4.0\\n
\\nAnd import the package in your file:
\\n#import \\"@local/chordx:0.4.0\\": *\\n
\\nHere chordx-docs you have the reference documentation that describes the functions and parameters used in this package. (Generated with tidy)
\\n#import \\"@preview/chordx:0.4.0\\": *\\n\\n#let chart-chord-sharp = chart-chord.with(size: 18pt)\\n#let chart-chord-round = chart-chord.with(size: 1.5em, design: \\"round\\")\\n\\n// Design \\"sharp\\"\\n#chart-chord-sharp(tabs: \\"x32o1o\\", fingers: \\"n32n1n\\")[C]\\n#chart-chord-sharp(tabs: \\"ooo3\\", fingers: \\"ooo3\\")[C]\\n\\n// Desigh \\"round\\" with position \\"bottom\\"\\n#chart-chord-round(tabs: \\"xn332n\\", fingers: \\"o13421\\", fret: 3, capos: \\"115\\", position: \\"bottom\\")[Cm]\\n#chart-chord-round(tabs: \\"onnn\\", fingers: \\"n111\\", capos: \\"313\\", position: \\"bottom\\")[Cm]\\n\\n// Design \\"round\\" with background color in chord name\\n#chart-chord-round(tabs: \\"xn332n\\", fingers: \\"o13421\\", fret: 3, capos: \\"115\\", background: silver)[Cm]\\n#chart-chord-round(tabs: \\"onnn\\", fingers: \\"n111\\", capos: \\"313\\", background: silver)[Cm]\\n
\\n#import \\"@preview/chordx:0.4.0\\": *\\n\\n#let piano-chord-sharp = piano-chord.with(layout: \\"F\\", size: 18pt)\\n#let piano-chord-round = piano-chord.with(layout: \\"F\\", size: 1.5em, design: \\"round\\")\\n\\n#piano-chord-sharp(keys: \\"B1, D2#, F2#\\", fill-key: blue)[B]\\n#piano-chord-round(keys: \\"B1, D2#, F2#\\", fill-key: yellow, position: \\"bottom\\")[B]\\n#piano-chord-round(keys: \\"B1, D2#, F2#\\", fill-key: red)[B]\\n
\\n#import \\"@preview/chordx:0.4.0\\": *\\n\\n#let chord = single-chord.with(\\n font: \\"PT Sans\\",\\n size: 12pt,\\n weight: \\"semibold\\",\\n background: silver\\n)\\n\\n#chord[Jingle][G][2] bells, jingle bells, jingle #chord[all][C][2] the #chord[way!][G][2] \\\\\\n#chord[Oh][C][] what fun it #chord[is][G][] to ride \\\\\\nIn a #chord[one-horse][A7][2] open #chord[sleigh,][D7][3] hey!\\n
\\nYou can read the latest changes in CHANGELOG.md
\\nManages acronyms so you don\'t have to.
\\n#import \\"@preview/acrostiche:0.3.5\\": *\\n\\n#init-acronyms((\\n \\"WTP\\": (\\"Wonderful Typst Package\\",\\"Wonderful Typst Packages\\"),\\n))\\n\\nAcrostiche is a #acr(\\"WTP\\")! This #acr(\\"WTP\\") enables easy acronyms manipulation.\\n\\nIts main features are auto-expansion of the first occurence, global or selective expansion reset #reset-all-acronyms(), implicit or manual plural form support (there may be multiple #acrpl(\\"WTP\\")), and customizable index printing. Have Fun!\\n
\\nThe main goal of Acrostiche is to keep track of which acronyms to define.
\\nFirst, define the acronyms in a dictionary, with the keys being the acronyms and the values being arrays of their definitions.\\nIf there is only a singular version of the definition, the array contains only one value.\\nIf there are both singular and plural versions, define the definition as an array where the first item is the singular definition and the second item is the plural.\\nThen, initialize Arostiche with the acronyms you just defined with the #init-acronyms(...)
function:
Here is a sample of the acronyms.typ
file:
#import \\"@preview/acrostiche:0.3.5\\": *\\n\\n#init-acronyms((\\n \\"NN\\": (\\"Neural Network\\"),\\n \\"OS\\": (\\"Operating System\\",),\\n \\"BIOS\\": (\\"Basic Input/Output System\\", \\"Basic Input/Output Systems\\"), \\n)) \\n
\\nOnce the acronyms are defined, you can use them in the text with the #acr(...)
function.\\nThe argument is the acronym as a string (for example, \\"BIOS\\"). On the first call of the function, it prints the acronym with its definition (for example, \\"Basic Input/Output System (BIOS)\\").\\nOn the next calls, it prints only the acronym.
To get the plural version of the acronym, you can use the #acrpl(...)
function that adds an \'s\' after the acronym.\\nIf a plural version of the definition is provided, it will be used if the first use of the acronym is plural.\\nOtherwise, the singular version is used, and a trailing \'s\' is added.
At any point in the document, you can reset acronyms with the functions #reset-acronym(...)
(for a single acronym) or reset-all-acronyms()
(to reset all acronyms). After a reset, the next use of the acronym is expanded.
You can also print an index of all acronyms used in the document with the #print-index()
function.\\nThe index is printed as a section for which you can choose the heading level, the numbering, and the outline parameters (with respectively the level: int
, numbering: none | string | function
, and outlined: bool
parameters).\\nYou can also choose their order with the sorted: string
parameter that accepts either an empty string (print in the order they are defined), \\"up\\" (print in ascending alphabetical order), or \\"down\\" (print in descending alphabetical order).\\nThe index contains all the acronyms you defined. You can use the title: string
parameter to change the name of the heading for the index section.\\nThe default value is \\"Acronyms Index\\". Passing an empty string for title
results in the index having no heading (i.e., no section for the index).\\nYou can customize the string displayed after the acronym in the list with the delimiter: \\":\\"
parameter.\\nTo adjust the spacing between the acronyms adjust the row-gutter: auto | int | relative | fraction | array
parameter, the default is 2pt
.
Finally, you can call the #display-def(...)
function to display the definition of an acronym. Set the plural
parameter to true to get the plural version.
| Function | Description |\\n|-------------------------------|---------------------------------------------------------------------------------------------------------------------|\\n| #init-acronyms(...) | Initializes the acronyms by defining them in a dictionary where the keys are acronyms and the values are definitions. |\\n| #acr(...) | Prints the acronym with its definition on the first call, then just the acronym in subsequent calls. |\\n| #acrpl(...) | Prints the plural version of the acronym. Uses plural definition if available, otherwise adds an \'s\' to the acronym. |\\n| #acrfull(...) | Displays the full (long) version of the acronym without affecting the state or tracking its usage. |\\n| #acrfullpl(...) | Displays the full plural version of the acronym without affecting the state or tracking its usage. |\\n| #reset-acronym(...) | Resets a single acronym so the next usage will include its definition again. |\\n| #reset-all-acronyms() | Resets all acronyms so the next usage will include their definitions again. |\\n| #print-index(...) | Prints an index of all acronyms used, with customizable heading level, order, and display parameters. |\\n| #display-def(...) | Displays the definition of an acronym. Use plural: true
to display the plural version of the definition. |
This is a bit of a hacky feature coming from pure serendipity.\\nThere is no enforcement of the type of the definitions.\\nMost users would naturally use strings as definitions, but any other content is acceptable.\\nFor example, you set your definition to a content block with rainbow-fille text, or even an image.\\nThe rainbow text is kinda cool because the gradient depend on the position in the page so depending on the position of first use the acronym will have a pseudo-random color.
\\nIf you use anything else than string for the definition, do not forget the trailing comma to force the definition to be an array (an array of a single element is not an array in Typst at the time of writing this).\\nI cannot guarantee that arbitrary content will remain available in future versions but I will do my best to keep it as it is kinda cool.\\nIf you find cool uses, please reach out to show me!
\\nPS: For the smart trouble-maker in the back that are thinking about nesting an acronym call in the definition of an acronym, I am way ahead of you and yes it is (kinda) possible.\\nIf you point to another acronym, it all works fine.\\nIf you point to the same acronym, you obviously create a recursive situation, and it fails.\\nIt will not converge, and the compiler will warn you and will panic.\\nBe nice to the compiler, don\'t throw recursive traps.
\\nHere is a minimal working example of funky acronyms:
\\n#import \\"@preview/acrostiche:0.3.5\\": * \\n#init-acronyms((\\n \\"RFA\\": ([#text(fill: gradient.linear(..color.map.rainbow))[Rainbow Filled Acronym]],), \\n \\"NA\\": ([Nested #acr(\\"RFA\\") Acronym],)\\n))\\n#acr(\\"NA\\")\\n
\\ndisplay-def
leverages the state display
function and only works if the return value is actually printed in the document. For more information on states, see the Typst documentation on states.Thank you to the contributors for proposing new features: caemor, AurelWeinhold, daniel-eder.
\\nIf you notice any bug or want to contribute a new feature, please open an issue or a merge request on the fork Grisely/packages
\\n","description":"Manages acronyms so you don\'t have to. Quick Start\\n#import \\"@preview/acrostiche:0.3.5\\": *\\n\\n#init-acronyms((\\n \\"WTP\\": (\\"Wonderful Typst Package\\",\\"Wonderful Typst Packages\\"),\\n))\\n\\nAcrostiche is a #acr(\\"WTP\\")! This #acr(\\"WTP\\") enables easy acronyms manipulation.\\n\\nIts main features…","guid":"https://typst.app/universe/package/acrostiche","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-10T08:35:22.570Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"dining-table (0.1.0) | Column-wise table definitions for big data","url":"https://typst.app/universe/package/dining-table","content":"dining-table
PackageImplements a layer on top of table to allow the user to define a table by column rather than by row, to automatically handle headers and footers, to implement table footnotes, to handle nested column quirks for you, to handle rendering nested data structures.
\\nBasically, if you are tabulating data where each row is an observation, and some features (columns) are to be grouped (a common case for scientific data) then this package might be worth checking out. Another use case is where you have multiple tables with identical layouts, and you wish to keep them all consistent with one another.
\\nSee the manual for in-depth usage, but for a quick reference, here is the ledger example (which is fully featured)
\\n#import \\"@preview/dining-table:0.1.0\\"\\n\\n#let data = (\\n (\\n date: datetime.today(),\\n particulars: lorem(05),\\n ledger: [JRS123] + dining-table.note.make[Hello World],\\n amount: (unit: $100$, decimal: $00$),\\n total: (unit: $99$, decimal: $00$),\\n ),\\n)*7 \\n\\n#import \\"@preview/typpuccino:0.1.0\\"\\n#let bg-fill-1 = typpuccino.latte.base\\n#let bg-fill-2 = typpuccino.latte.mantle\\n\\n#let example = (\\n (\\n key: \\"date\\",\\n header: align(left)[Date],\\n display: (it)=>it.display(auto),\\n fill: bg-fill-1,\\n align: start,\\n gutter: 0.5em,\\n ),\\n (\\n key: \\"particulars\\",\\n header: text(tracking: 5pt)[Particulars],\\n width: 1fr,\\n gutter: 0.5em,\\n ),\\n (\\n key: \\"ledger\\",\\n header: [Ledger],\\n fill: bg-fill-2,\\n width: 2cm,\\n gutter: 0.5em,\\n ),\\n (\\n header: align(center)[Amount],\\n fill: bg-fill-1,\\n gutter: 0.5em,\\n hline: arguments(stroke: dining-table.lightrule),\\n children: (\\n (\\n key: \\"amount.unit\\", \\n header: align(left)[£], \\n width: 5em, \\n align: right,\\n vline: arguments(stroke: dining-table.lightrule),\\n gutter: 0em,\\n ),\\n (\\n key: \\"amount.decimal\\",\\n header: align(right, text(number-type: \\"old-style\\")[.00]), \\n align: left\\n ),\\n )\\n ),\\n (\\n header: align(center)[Total],\\n gutter: 0.5em,\\n hline: arguments(stroke: dining-table.lightrule),\\n children: (\\n (\\n key: \\"total.unit\\", \\n header: align(left)[£], \\n width: 5em, \\n align: right,\\n vline: arguments(stroke: dining-table.lightrule),\\n gutter: 0em,\\n ),\\n (\\n key: \\"total.decimal\\",\\n header: align(right, text(number-type: \\"old-style\\")[.00]), \\n align: left\\n ),\\n )\\n ),\\n)\\n\\n#set text(size: 11pt)\\n#set page(height: auto, margin: 1em)\\n#dining-table.make(columns: example, \\n data: data, \\n notes: dining-table.note.display-list\\n)\\n
\\n","description":"Version 0.1.0 Implements a layer on top of table to allow the user to define a table by column rather than by row, to automatically handle headers and footers, to implement table footnotes, to handle nested column quirks for you, to handle rendering nested data structures.\\n\\nBasic…","guid":"https://typst.app/universe/package/dining-table","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-10T08:06:02.074Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/dining-table/0.1.0/examples/ledger.png","type":"photo","width":1191,"height":349}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"jlyfish (0.1.0) | Julia code evaluation inside your Typst document","url":"https://typst.app/universe/package/jlyfish","content":"Jlyfish is a package for Julia and Typst that allows you to integrate Julia\\ncomputations in your Typst document.
\\n\\nYou should use Jlyfish if you want to write a Typst document and have some of\\nthe content automatically produced by Julia code but want the source code for\\nthat within your document source.\\nIt fills a similar role as PythonTeX\\ndoes for Python and LaTeX.\\nNote that this is different from tools like Quarto where\\nyou write documents in Markdown, also integrate some Julia code, but then might\\nuse Typst only as a backend to produce the final document.
\\nSee below for a quick introduction or read the\\nwiki for an in depth\\nexplanation.
\\nSince Jlyfish builds a bridge between Julia and Typst, we also have to get two\\nthings running.\\nFirst, install the Julia package TypstJlyfish
from the general registry by\\nexecuting
julia> ]\\n\\n(@v1.10) pkg> add TypstJlyfish\\n
\\nYou only have to do this once.\\n(It is like installing and using the Pluto notebook system, if you are familiar\\nwith that.)
\\nWhen you want to use Jlyfish in a Typst document (say, your-document.typ
),\\nadd the following line at the top:
#import \\"@preview/jlyfish:0.1.0\\": *\\n
\\nThen, open a Julia REPL and run
\\njulia> import TypstJlyfish\\n\\njulia> TypstJlyfish.watch(\\"your-document.typ\\")\\n
\\nJlyfish facilitates the communication between Julia and Typst via a JSON file.\\nBy default, Jlyfish uses the name of your document and adds a -jlyfish.json
,\\nso your-document.typ
would become your-document-jlyfish.json
.\\nThis can be configured, of course.
To let Typst know of the computed data in the JSON file, add the following line\\nto your document:
\\n#read-julia-output(json(\\"your-document-jlyfish.json\\"))\\n
\\nYou can then place some Julia code in your Typst source using the #jl
\\nfunction:
What is the sum of the whole numbers from one to a hundred? #jl(`sum(1:100)`)\\n
\\nHead over to the wiki\\nto learn more!
\\nJust to show what is possible with Jlyfish:
\\n#import \\"@preview/jlyfish:0.1.0\\": *\\n\\n#set page(width: auto, height: auto, margin: 1em)\\n#set text(font: \\"Alegreya Sans\\")\\n#let note = text.with(size: .7em, fill: luma(100), style: \\"italic\\")\\n\\n#read-julia-output(json(\\"demo-jlyfish.json\\"))\\n#jl-pkg(\\"Colors\\", \\"Typstry\\", \\"Makie\\", \\"CairoMakie\\")\\n\\n#grid(\\n columns: 2,\\n gutter: 1em,\\n align: top,\\n [\\n #note[Generate Typst code in Julia:]\\n\\n #set text(size: 4em)\\n #jl(```julia\\n using Typstry, Colors\\n\\n parts = map([:red, :green, :purple], [\\"Ju\\", \\"li\\", \\"a\\"]) do name, text\\n color = hex(Colors.JULIA_LOGO_COLORS[name])\\n \\"#text(fill: rgb(\\\\\\"$color\\\\\\"))[$text]\\"\\n end\\n TypstText(join(parts))\\n ```)\\n ],\\n [\\n #note[Produce images in Julia:]\\n\\n #set image(width: 10em)\\n #jl(recompute: false, ```\\n using Makie, CairoMakie\\n\\n as = -2.2:.01:.7\\n bs = -1.5:.01:1.5\\n C = [a + b * im for a in as, b in bs]\\n function mandelbrot(c)\\n z = c\\n i = 1\\n while i < 100 && abs2(z) < 4\\n z = z^2 + c\\n i += 1\\n end\\n i\\n end\\n\\n contour(as, bs, mandelbrot.(C), axis = (;aspect = DataAspect()))\\n ```)\\n ],\\n [\\n #note[Hand over raw data from Julia to Typst:]\\n #let barchart(counts) = {\\n set align(bottom)\\n let bars = counts.map(count => rect(\\n width: .3em,\\n height: count * 9em,\\n stroke: white,\\n fill: blue,\\n ))\\n stack(dir: ltr, ..bars)\\n }\\n\\n #jl-raw(fn: it => barchart(it.result.data), ```julia\\n p = .5\\n n = 40\\n counts = zeros(n + 1)\\n for _ in 1:10_000\\n count = 0\\n for _ in 1:n\\n if rand() < p\\n count += 1\\n end\\n end\\n counts[count + 1] += 1\\n end\\n\\n counts ./= maximum(counts)\\n lo, hi = findfirst(>(1e-3), counts), findlast(>(1e-3), counts)\\n counts[lo:hi]\\n ```)\\n ],\\n [\\n #note[See errors, stdout, and logs:]\\n\\n #jl(```julia\\n println(\\"Hello from stdout!\\")\\n @info \\"Something to note\\" n p\\n @warn \\"You should read this!\\"\\n this_does_not_exist\\n ```)\\n ]\\n)\\n
\\n","description":"Jlyfish is a package for Julia and Typst that allows you to integrate Julia computations in your Typst document. You should use Jlyfish if you want to write a Typst document and have some of the content automatically produced by Julia code but want the source code for that…","guid":"https://typst.app/universe/package/jlyfish","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-08T08:16:15.547Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/jlyfish/0.1.0/assets/logo.svg","type":"photo","width":878,"height":357},{"url":"https://img.shields.io/badge/docs-wiki-blue","type":"photo","width":66,"height":20},{"url":"https://img.shields.io/github/license/andreasKroepelin/TypstJlyfish.jl","type":"photo","width":78,"height":20},{"url":"https://img.shields.io/github/v/release/andreasKroepelin/TypstJlyfish.jl","type":"photo","width":222,"height":20},{"url":"https://img.shields.io/github/stars/andreasKroepelin/TypstJlyfish.jl","type":"photo","width":82,"height":20},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/jlyfish/0.1.0/examples/demo.svg","type":"photo","width":648,"height":522}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"cheda-seu-thesis (0.3.0) | 东南大学本科毕设与研究生学位论文模板。UNOFFICIAL Southeast University Thesis.","url":"https://typst.app/universe/package/cheda-seu-thesis","content":"使用 Typst 复刻东南大学「本科毕业设计(论文)报告」模板和「研究生学位论文」模板。
\\n请在 init-files
目录内查看 Demo PDF。
\\n\\n[!IMPORTANT]
\\n此模板是民间模板,有不被学校认可的风险。
\\n本模板虽已尽力尝试复原原始 Word 模板,但可能仍然存在诸多格式问题。
\\nTypst 是一个仍在活跃开发、可能会有较大变更的排版工具,请选择最新版模板与本模板建议的 Typst 版本相配合使用。
\\n
\\n\\n[!CAUTION]
\\n\\n
本模板需要使用 Typst 0.11.x 编译。
\\n此模板已上传 Typst Universe ,可以使用 typst init
功能初始化,也可以使用 Web App 编辑。Typst Universe 上的模板可能不是最新版本。如果需要使用最新版本的模板,从本 repo 中获取。
请先安装位于 fonts
目录内的全部字体。然后,您可以使用以下两种方式使用本模板:
init-files
目录内的示例文件。typst init @preview/cheda-seu-thesis:0.2.2
来获取此模板与初始化文件。随后,您可以通过编辑示例文件来生成想要的论文。两种论文格式的说明都在对应的示例文档内。
\\n如您使用 VSCode 作为编辑器,可以尝试使用 Tinymist 与 Typst Preview 插件。如有本地包云同步需求,可以使用 Typst Sync 插件。更多编辑技巧,可查阅 https://github.com/nju-lug/modern-nju-thesis#vs-code-本地编辑推荐 。
\\n\\n\\n[!NOTE]
\\n由于字体原因,不建议使用 Web App 编辑此模板。
\\n
请打开 https://typst.app/universe/package/cheda-seu-thesis 并点击 Create project in app
,或在 Web App 中选择 Start from a template
,再选择 cheda-seu-thesis
。
然后,请将 https://github.com/csimide/SEU-Typst-Template/tree/master/fonts 内的 所有 字体上传到 Typst Web App 内该项目的根目录。注意,之后每次打开此项目,浏览器都会花费很长时间从 Typst Web App 的服务器下载这一批字体,体验较差。
\\n最后,请按照自动打开的文件的提示操作。
\\n此 Typst 模板按照《东南大学研究生学位论文格式规定》制作,制作时参考了 SEUThesis 模板。
\\n当前支持进度:
\\n此 Typst 模板基于东南大学本科毕业设计(论文)报告模板(2024 年 1 月)仿制,原模板可以在教务处网站上下载(2019 年 9 月版 , 2024 年 1 月版)。
\\n当前支持进度:
\\n\\n\\n[!NOTE]
\\n可以看看隔壁 https://github.com/TideDra/seu-thesis-typst/ 项目,也正在使用 Typst 实现毕业设计(论文)报告模板,还提供了毕设翻译模板。该项目的实现细节与本模板并不相同,您可以根据自己的喜好选择。
\\n
#h(2em)
手动缩进两个字符。参考文献格式不完全符合要求。Typst 自带的 GB/T 7714-2015 numeric 格式与学校要求格式相比,有以下问题:
\\n学校要求在作者数量较多时,英文使用 et al.
中文使用 等
来省略。但是,Typst 目前仅可以显示为单一语言。
A: 该问题系 Typst 的 CSL 解析器不支持 CSL-M 导致的。
\\nlayout
功能,而 Typst 尚不支持 CSL-M 扩展功能。详见 https://github.com/typst/typst/issues/2793 与 https://github.com/typst/citationberg/issues/5 。language
字段。参见 https://github.com/typst/hayagriva/pull/126 。因为上述原因,目前很难使用 Typst 原生方法实现根据语言自动选用 et al.
与 等
。
OrangeX4 和我写了一个基于查找替换的 bilingual-bibliography
功能,试图在 Typst 支持 CSL-M 前实现中文西文使用不同的关键词。
本模板的 Demo 文档内已使用 bilingual-bibliography
引用,请查看 Demo 文档以了解用法。注意,该功能仍在测试,很可能有 Bug,详见 https://github.com/csimide/SEU-Typst-Template/issues/1 。
\\n\\n请在 https://github.com/nju-lug/modern-nju-thesis/issues/3 查看更多有关双语参考文献实现的讨论。
\\n本模板曾经尝试使用 https://github.com/csimide/cslper 作为双语参考文献的实现方法。
\\n
学校给出的范例中,除了纯电子资源,即使引用文献来自线上渠道,也均不加 OL
、访问日期、DOI 与 链接。但是,Typst 内置的 GB/T 7714-2015 numeric 格式会为所有 bib 内定义了链接/DOI 的文献添加 OL
标记和链接/DOI 。
A: 该问题系学校的标准与 GB/T 7714-2015 不完全一致导致的。
\\n请使用 style: \\"./seu-thesis/gb-t-7714-2015-numeric-seu.csl\\"
,会自动依据文献类型选择是否显示 OL
标记和链接/DOI。
\\n\\n\\n原文件基于 CC-BY-SA 3.0 协议共享。
\\n
作者大小写(或者其他细节)与学校范例不一致。
\\n学位论文中,学校要求引用其他学位论文的文献类型应当写作 [D]: [博士学位论文].
格式,但模板显示为 [D]
,不显示子类别。
学位论文中,学校给出的范例使用全角符号,如全角方括号、全角句点等。
\\n引用条目丢失 .
,如 [M]2nd ed
。
3~6 A: 学校用的是 GB/T 7714-2015 的方言,曾经有学长把它叫做 GB/T 7714-SEU ,目前没找到完美匹配学校要求的 CSL(不同学院的要求也不太一样),后续会写一个符合要求的 CSL 文件。
\\n2024-05-02 更新: 现已初步实现 CSL。不得不说 Typst 的 CSL 支持成谜……目前修复情况如下:
\\n.
了。引用其他学位论文时,GB7714-2015/本科毕设/学位论文均要求注明 地点: 学校名称, 年份.
。但是模板不显示这一项。
A: Typst 不支持 school
institution
作为 publisher
的别名,亦不支持解析 csl 中的 institution
( https://github.com/typst/hayagriva/issues/112 )。如需修复,请手动修改 bib 文件内对应条目,在 school = {学校名称},
下加一行 publisher = {学校名称},
。
@phdthesis{Example1,\\n type = {{硕士学位论文}},\\n title = {{摸鱼背景下的Typst模板使用研究}},\\n author = {王, 东南},\\n year = {2024},\\n langid = {chinese},\\n address = {南京},\\n school = {东南大学},\\n publisher = {东南大学},\\n}\\n
\\n正文中连续引用,上标合并错误(例如,引用 1 2 3 4 应当显示为 [1-4] ,但是显示为 [1,4] )。
\\nA: 临时方案是把 csl 文件里 after-collapse-delimiter=\\",\\"
改成 after-collapse-delimiter=\\"-\\"
。本模板附带的 CSL 文件已做此修改。
详细原因请见 https://github.com/typst/hayagriva/issues/154 。
\\nhttps://github.com/typst/hayagriva/pull/176 正尝试解决这一 bug。该 bug 修复后,请及时撤销上述对 csl 的临时修改。
\\n如果您在使用过程中遇到任何问题,请提交 issue。本项目欢迎您的 PR。如果有其他模板需求也可以在 issue 中提出。
\\n除下述特殊说明的文件外,此项目使用 MIT License 。
\\ninit-files/demo_image/
路径下的文件来自东南大学教务处本科毕设模板。seu-thesis/assets/
路径下的文件是由东南大学教务处模板经二次加工得到,或从东南大学视觉设计中取得。fonts
路径下的文件是此模板用到的字体。东南大学本科毕业设计(论文)参考模板 (2024年1月修订).docx
是教务处提供的毕设论文模板。本模板欢迎二次开发。在二次开发前,建议了解本模板的主要特性与关联的文件:
\\n有较为麻烦的图表、公式编号(图表编号格式不相同,甚至附录与正文中图表编号格式也不相同;图的名称在图下方,表的名称在表上方;公式不是居中对齐,公式编号位置不是右侧上下居中)。
\\ni-figured
包完成。(仅研究生学位论文)奇数页偶数页页眉不同,且有页眉中显示章节名称的需求。
\\nseu-thesis/parts/main-body-degree-fn.typ
。chic-hdr
而不是自造轮子,由于历史遗留问题本模板暂未改用。支持双语显示参考文献(自动使用 et al.
和 等
)
bilingual-bibliography
,关联的文件是 seu-thesis/utils/bilingual-bibliography.typ
。bilingual-bibliography
的更多信息,请查看 https://github.com/nju-lug/modern-nju-thesis/issues/3\\n\\n","description":"使用 Typst 复刻东南大学「本科毕业设计(论文)报告」模板和「研究生学位论文」模板。 请在 init-files 目录内查看 Demo PDF。\\n\\n[!IMPORTANT]\\n\\n此模板是民间模板,有不被学校认可的风险。\\n\\n本模板虽已尽力尝试复原原始 Word 模板,但可能仍然存在诸多格式问题。\\n\\nTypst 是一个仍在活跃开发、可能会有较大变更的排版工具,请选择最新版模板与本模板建议的 Typst 版本相配合使用。\\n\\n[!CAUTION]\\n\\n本模板在 0.2.2 -> 0.3.0 时进行了破坏性变更。有关此次变更的详细信息,请查看更新日志\\n\\n东南大学论文…","guid":"https://typst.app/universe/package/cheda-seu-thesis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-08T08:13:00.460Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"based (0.1.0) | Encoder and decoder for base64, base32, and base16.","url":"https://typst.app/universe/package/based","content":"[!NOTE]
\\n本模板内造的轮子比较多,而且我的代码质量一般,请酌情取用。
\\n
A package for encoding and decoding in base64, base32, and base16.
\\nThe package comes with three submodules: base64
, base32
, and base16
. All of them have an encode
and decode
function. The package also provides the function aliases
encode64
/ decode64
,encode32
/ decode32
, andencode16
/ decode16
.Both base64 and base32 allow you to choose whether to use padding or not (pad
parameter). It is enabled by default. Base64 also allows you to encode with the URL-safe alphabet (url
parameter), while base32 allows you to encode or decode with the \\"extended hex\\" alphabet (hex
parameter). Both options are disabled by default. The base16 encoder uses lowercase letters, the decoder is case-insensitive.
You can encode strings, arrays and bytes. The encode
function will return a string, while the decode
function will return bytes.
#import \\"@preview/based:0.1.0\\": base64, base32, base16\\n\\n#table(\\n columns: 3,\\n\\n raw(base64.encode(\\"Hello world!\\")),\\n raw(base32.encode(\\"Hello world!\\")),\\n raw(base16.encode(\\"Hello world!\\")),\\n\\n str(base64.decode(\\"SGVsbG8gd29ybGQh\\")),\\n str(base32.decode(\\"JBSWY3DPEB3W64TMMQQQ====\\")),\\n str(base16.decode(\\"48656C6C6F20776F726C6421\\"))\\n)\\n
\\nA package for creating dropped capitals.
\\nThis package exports a single dropcap
function that is used to create dropped capitals. The function takes one or two positional arguments, and several optional keyword arguments for customization:
| Parameter | Type | Description | Default |\\n|------------------|-------------------------------|-----------------------------------------------------------|---------|\\n| height
| integer
, length
, auto
| The height of the dropped capital. | 2
|\\n| justify
| boolean
, auto
| Whether the text should be justified. | auto
|\\n| gap
| length
| The space between the dropped capital and the text. | 0pt
|\\n| hanging-indent
| length
| The indent of lines after the first. | 0pt
|\\n| overhang
| length
, relative
, ratio
| How much the dropped capital should hang into the margin. | 0pt
|\\n| depth
| integer
, length
| The space below the dropped capital. | 0pt
|\\n| transform
| function
, none
| A function to be applied to the dropped capital. | none
|\\n| ..text-args
| | How to style the text
of the dropped capital. | |
Some parameters allow values of different types for maximum flexibility:
\\nheight
is given as an integer, it is interpreted as a number of lines. If given as auto
, the dropped capital will not be scaled and remain at its original size.overhang
has a relative part, it is resolved relative to the width of the dropped capital.depth
is given as an integer, it is interpreted as a number of lines.transform
function takes the extracted or passed dropped capital and returns the content to be shown.If two positional arguments are given, the first is used as the dropped capital, and the second as the text. If only one argument is given, the dropped capital is automatically extracted from the text.
\\nIf no explicit dropped capital is passed, it is extracted automatically. For this to work, the package looks into the content making up the first paragraph and extracts the first letter of the first word. This letter is then split off from the rest of the text and used as the dropped capital. There are some special cases to consider:
\\nbox
, the whole box is used as the dropped capital.Affixes, such as punctuation, super- and subscripts, quotes, and spaces will also be detected and stay with the dropped capital.
\\nTo wrap the text around the dropped capital, the paragraph is split into two parts: the part next to the dropped capital and the part after it. As Typst doesn\'t natively support wrapping text around an element, this package splits the paragraph at word boundaries and tries to fit as much in the first part as possible. This approach comes with some limitations:
\\nTo determine whether an elements fits into the first part, the position of top edge of the element is crucial. If the top edge is above the baseline of the dropped capital, the element is considered to be part of the first part. This means that elements with a large height will be part of the first part. This is done to avoid gaps between the two parts of the paragraph.
\\nIn case you wish to style the dropped capital more than what is possible with the arguments of the text
function, you can use a transform
function. This function takes the extracted or passed dropped capital and returns the content to be shown. The function is provided with the context of the dropped capital.
Note that when using em
units, they are resolved relative to the font size of the dropped capital. When the dropped capital is scaled to fit the given height
parameter, the font size is adjusted so that the bounds of the transformed content match the given height. For that, the top-edge
and bottom-edge
parameters of text-args
are set to bounds
by default.
#import \\"@preview/droplet:0.3.0\\": dropcap\\n\\n#set par(justify: true)\\n\\n#dropcap(\\n height: 3,\\n gap: 4pt,\\n hanging-indent: 1em,\\n overhang: 8pt,\\n font: \\"Curlz MT\\",\\n)[\\n *Typst* is a new markup-based typesetting system that is designed to be as\\n _powerful_ as LaTeX while being _much easier_ to learn and use. Typst has:\\n\\n - Built-in markup for the most common formatting tasks\\n - Flexible functions for everything else\\n - A tightly integrated scripting system\\n - Math typesetting, bibliography management, and more\\n - Fast compile times thanks to incremental compilation\\n - Friendly error messages in case something goes wrong\\n]\\n
\\nA package for creating custom shorthands for math equations.
\\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.
#import \\"@preview/quick-maths:0.1.0\\": shorthands\\n\\n#show: shorthands.with(\\n ($+-$, $plus.minus$),\\n ($|-$, math.tack),\\n ($<=$, math.arrow.l.double) // Replaces \'≤\'\\n)\\n\\n$ x^2 = 9 quad <==> quad x = +-3 $\\n$ A or B |- A $\\n$ x <= y $\\n
\\nTypst template for Polytech (Grenoble) internship reports.
\\n\\nEither use this template in the Typst web app, or use the command line to initialize a new project based on this template:
\\ntypst init @preview/georges-yetyp\\n
\\nThen, replace logo.png
with the logo of the company you worked for, fill in all the details in the rapport
parameters, and start writing below.
Adding support for other schools of the Polytech network would be fairly easy if you want to re-use this template. All that is needed is a copy of their logo (with the authorization to use it). Submissions are welcome.
\\n","description":"French version Typst template for Polytech (Grenoble) internship reports.\\n\\nUsage\\n\\nEither use this template in the Typst web app, or use the command line to initialize a new project based on this template:\\n\\ntypst init @preview/georges-yetyp\\n\\n\\nThen, replace logo.png with the logo of…","guid":"https://typst.app/universe/package/georges-yetyp","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-05T08:19:45.945Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/georges-yetyp/0.2.0/thumbnail.png","type":"photo","width":1191,"height":1684,"blurhash":"L07UI{j[fQj[j[fQfQfQfQfQfQfQ"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"sweet-graduate-resume (0.1.0) | A simple graduate student resume template","url":"https://typst.app/universe/package/sweet-graduate-resume","content":"A basic resume template in typst.
\\nTo compile/watch, make sure you pass the argument --font-path ./fonts/
to typst-cli.
If you use the helix editor, a configuration has been given in the repository.\\nThis auto-compiles your document on saving and you can preview the results in real time\\nusing a pdf viewer. Also provides autocomplete, code renaming, and other cool (LSP) features.
\\nMake sure you have tinymist and typstyle installed before using the helix config.
\\nThe FontAwesome Free/Brand fonts are licensed under Font Awesome Free License
\\nThe Codeberg SVG in the svg directory are licensed under Creative Commons CC0
\\nFor the rest, see LICENSE.
\\nFor fonts, please install the fonts from the repository of the project in codeberg.
\\n","description":"A basic resume template in typst. To compile/watch, make sure you pass the argument --font-path ./fonts/ to typst-cli.\\n\\nIf you use the helix editor, a configuration has been given in the repository. This auto-compiles your document on saving and you can preview the results in…","guid":"https://typst.app/universe/package/sweet-graduate-resume","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-04T08:06:35.506Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/sweet-graduate-resume/0.1.0/screenshot.png","type":"photo","width":1241,"height":1754}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"subpar (0.1.1) | Create sub figures easily.","url":"https://typst.app/universe/package/subpar","content":"Subpar is a Typst package for creating sub figures.
\\n#import \\"@preview/subpar:0.1.1\\"\\n\\n#set page(height: auto)\\n#set par(justify: true)\\n\\n#subpar.grid(\\n figure(image(\\"/assets/andromeda.jpg\\"), caption: [\\n An image of the andromeda galaxy.\\n ]), <a>,\\n figure(image(\\"/assets/mountains.jpg\\"), caption: [\\n A sunset illuminating the sky above a mountain range.\\n ]), <b>,\\n columns: (1fr, 1fr),\\n caption: [A figure composed of two sub figures.],\\n label: <full>,\\n)\\n\\nAbove in @full, we see a figure which is composed of two other figures, namely @a and @b.\\n
\\nContributions are most welcome, make sure to let others know you\'re working on something beforehand so no two people waste their time working on the same issue.\\nIt\'s recommended to have typst-test
installed to run tests locally.
A guide and API-reference for subpar can be found in it\'s manual.
\\n","description":"Subpar is a Typst package for creating sub figures. #import \\"@preview/subpar:0.1.1\\"\\n\\n#set page(height: auto)\\n#set par(justify: true)\\n\\n#subpar.grid(\\n figure(image(\\"/assets/andromeda.jpg\\"), caption: [\\n An image of the andromeda galaxy.\\n ]), ,\\n figure(image(\\"/assets…","guid":"https://typst.app/universe/package/subpar","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-03T08:35:12.575Z","media":[{"url":"https://raw.githubusercontent.com/examples/example.png","type":"photo"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"aloecius-aip (0.0.1) | Typst template for reproducing AIP - Journal of Chemical Physics paper (draft)","url":"https://typst.app/universe/package/aloecius-aip","content":"This is a typst template for reproducing papers of American Institute of Physics (AIP) publishing house, mainly draft version of Journal of Chemical Physics. This is inspired by the overleaf $\\\\LaTeX$ template of AIP journals.
\\nYou can use this template with typst web app by simply clicking on \\"Start from template\\" on the dashboard and searching for aloecius-aip
.
For local usage, you can use the typst CLI by invoking the following command
\\ntypst init @preview/aloecius-aip\\n
\\ntypst will automatically create a new directory with all the necessary files needed to compile the project.
\\nThe preamble or the header of the document should be written in the following way with your own necessary input variables to recreate the same formatting as seen in the sample.pdf
#import \\"@preview/aloecius-aip:0.0.1\\": *\\n\\n#show: article.with(\\n title: \\"Typst Template for Journal of Chemical Physics (Draft)\\",\\n authors: (\\n \\"Author 1\\": author-meta(\\n \\"GU\\",\\n email: \\"user1@domain.com\\",\\n ),\\n \\"Author 2\\": author-meta(\\n \\"GU\\",\\n cofirst: false\\n ),\\n \\"Author 3\\": author-meta(\\n \\"UG\\"\\n )\\n ),\\n affiliations: (\\n \\"UG\\": \\"University of Global Sciences\\",\\n \\"GU\\": \\"Institute for Chemistry, Global University of Sciences\\"\\n ),\\n abstract: [\\n Here goes the abstract. \\n ],\\n bib: bibliography(\\"./reference.bib\\")\\n)\\n
\\ntitle
: Title of the paperauthors
: A dictionary connecting the key as name of the author(s) and the value to be the affiliation of them including university, email, mail address, authorship and an alias, an example usage is shown belowExample:\\n(\\n \\"Author Name\\": (\\n \\"affiliation\\": \\"affiliation-label\\",\\n \\"email\\": \\"author.name@example.com\\", // Optional\\n \\"address\\": \\"Mail address\\", // Optional\\n \\"name\\": \\"Alias Name\\", // Optional\\n \\"cofirst\\": false // Optional, identify whether this author is the co-first author\\n )\\n)\\n
\\naffiliations
: Dictionary of affiliations where keys are affiliations labels and values are affiliations addresses, and example usage is as followsExample:\\n (\\n \\"affiliation-label\\": \\"Institution Name, University Name, Road, Post Code, Country\\"\\n )\\n
\\nabstract
: Abstract of the paperbib
: passing the bibliography file wrapped into the typst bibliography()
function, both Hayagriva
and .bib
format is supported.This is a typst adaptation of LaTeX\'s moderncv, a modern curriculum vitae class.
\\nThis template uses FontAwesome icons via the fontawesome typst package.\\nIn order to properly use it, you need to have fontawesome installed on your system or have typst configured (via --font-path
) to use the fontawesome font files.\\nYou can download fontawesome here.
#import \\"@preview/moderner-cv:0.1.0\\": *\\n\\n#show: moderner-cv.with(\\n name: \\"Jane Doe\\",\\n lang: \\"en\\",\\n social: (\\n email: \\"jane.doe@example.com\\",\\n github: \\"jane-doe\\",\\n linkedin: \\"jane-doe\\",\\n ),\\n)\\n\\n// ...\\n
\\nTo build and test the template locally, you can run pixi run watch
in the root of this repository.\\nPlease ensure to have linked this package to your local typst packages, see here:
# linux\\nmkdir -p ~/.local/share/typst/packages/preview/moderner-cv\\nln -s $(pwd) ~/.local/share/typst/packages/preview/moderner-cv/0.1.0\\n\\n# macos\\nmkdir -p ~/Library/Application\\\\ Support/typst/packages/preview/moderner-cv\\nln -s $(pwd) ~/Library/Application\\\\ Support/typst/packages/preview/moderner-cv/0.1.0\\n
\\n","description":"This is a typst adaptation of LaTeX\'s moderncv, a modern curriculum vitae class. Requirements\\n\\nThis template uses FontAwesome icons via the fontawesome typst package. In order to properly use it, you need to have fontawesome installed on your system or have typst configured (via…","guid":"https://typst.app/universe/package/moderner-cv","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-03T08:12:32.121Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/moderner-cv/0.1.0/assets/example.png","type":"photo","width":2480,"height":3507}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"soviet-matrix (0.1.1) | Tetris game in Typst","url":"https://typst.app/universe/package/soviet-matrix","content":"This is a classic Tetris game implemented using Typst. The goal is to manipulate falling blocks to create and clear horizontal lines without letting the blocks stack up to the top of the playing field.
\\nYou can play the game in two ways:
\\nOnline:
\\nLocally:
\\ntypst init @preview/soviet-matrix\\n
\\nmain.typ
in the created directory.Enjoy the game!
\\nIf you want to play different game scenarios, you can change the game seed using the following method:
\\n#import \\"@preview/soviet-matrix:0.1.0\\": game\\n#show: game.with(seed: 123) // Change the game seed\\n
\\nReplace 123
with any number of your choice.
Modify the actions
parameter in the game.with
method to change the key bindings. The default key bindings are as follows:
#show: game.with(seed: 0, actions: (\\n left: (\\"a\\", ),\\n right: (\\"d\\", ),\\n down: (\\"s\\", ),\\n left-rotate: (\\"q\\", ),\\n right-rotate: (\\"e\\", ),\\n half-turn: (\\"w\\", ),\\n fast-drop: (\\"f\\", ),\\n))\\n
\\n","description":"This is a classic Tetris game implemented using Typst. The goal is to manipulate falling blocks to create and clear horizontal lines without letting the blocks stack up to the top of the playing field. How to Play\\n\\nYou can play the game in two ways:\\n\\nOnline:\\n\\nVisit https…","guid":"https://typst.app/universe/package/soviet-matrix","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-03T08:11:24.400Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/soviet-matrix/0.1.1/demo.gif","type":"photo","width":1468,"height":850}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"splash (0.4.0) | A library of color palettes for Typst.","url":"https://typst.app/universe/package/splash","content":"Add a splash of color to your project with these palettes for Typst.
\\nThis library provides different color palettes with human-readable names in\\nTypst dictionaries. Currently there are just a few different palettes to choose\\nfrom. Any contributions or suggestions are welcome!
\\nNote: splash
is in the Typst Package Repository. See how to use\\nit in the example below.
#import \\"@preview/splash:0.4.0\\": xcolor\\n\\n#box(width: 3em, height: 1em, fill: xcolor.dandelion)\\n
\\nSee the different colors in the documentation.
\\n","description":"Add a splash of color to your project with these palettes for Typst. This library provides different color palettes with human-readable names in Typst dictionaries. Currently there are just a few different palettes to choose from. Any contributions or suggestions are welcome!\\n\\nNo…","guid":"https://typst.app/universe/package/splash","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-03T07:50:22.707Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"vartable (0.1.2) | A simple package to make variation table","url":"https://typst.app/universe/package/vartable","content":"An easy way to render variation table on typst, built on fletcher
\\nThe documention
#import \\"@preview/Tabvar:0.1.0\\": tabvar\\n
\\nTurn this :
\\n#import \\"@preview/Tabvar:0.1.0\\": tabvar\\n\\n#tabvar(\\n init: (\\n variable: $x$,\\n label: (\\n ([sign of cos], \\"Sign\\"),\\n ([variation of cos], \\"Variation\\"),\\n ([sign of sin], \\"Sign\\"),\\n ([variation of sin], \\"Variation\\"),\\n ),\\n ),\\n domain: ($0$, $ pi / 2 $, $ pi $, $ (2pi) / 3 $, $ 2 pi $),\\n content: (\\n ($-$, (), $+$, ()),\\n (\\n (top, $1$),\\n (),\\n (bottom, $-1$),\\n (),\\n (top, $1$),\\n ),\\n ($+$, $-$, (), $+$),\\n (\\n (center, $0$),\\n (top, $1$),\\n (),\\n (bottom, $-1$),\\n (top, $1$),\\n ),\\n ),\\n)\\n
\\nInto this
\\n#import \\"@preview/Tabvar:0.1.0\\": tabvar\\n\\n#tabvar(\\n init: (\\n variable: $x$,\\n label: (\\n ([sign of $f$], \\"Sign\\"),\\n ([variation of $f$], \\"Variation\\"),\\n ),\\n ),\\n domain: ($ -oo $, $ 0 $, $ +oo $),\\n content: (\\n ($+$, (\\"||\\", $+$)),\\n (\\n (center, $0$),\\n (bottom, top, \\"||\\", $-oo$, $+oo$),\\n (center, $0$),\\n ),\\n ),\\n)\\n
\\nfletcher 0.5.2
A small package for dynamic slides in typst.
\\nminideck provides basic functionality for dynamic slides (pause
, uncover
, ...), integration with fletcher and CetZ, and some minimal infrastructure for theming.
Call minideck.config
to get the functions you want to use:
#import \\"@preview/minideck:0.2.1\\"\\n\\n#let (template, slide, title-slide, pause, uncover, only) = minideck.config()\\n#show: template\\n\\n#title-slide[\\n = Slides with `minideck`\\n == Some examples\\n John Doe\\n\\n #datetime.today().display()\\n]\\n\\n#slide[\\n = Some title\\n\\n Some content\\n\\n #show: pause\\n\\n More content\\n\\n 1. One\\n 2. Two\\n #show: pause\\n 3. Three\\n]\\n
\\nThis will show three subslides with progressively more content. (Note that the default theme uses the font Libertinus Sans from the Libertinus family, so you may want to install it.)
\\nInstead of #show: pause
, you can use #uncover(2,3)[...]
to make content visible only on subslides 2 and 3, or #uncover(from: 2)[...]
to have it visible on subslide 2 and following.
The only
function is similar to uncover
, but instead of hiding the content (without affecting the layout), it removes it.
#slide[\\n = `uncover` and `only`\\n \\n #uncover(1, from:3)[\\n Content visible on subslides 1 and 3+\\n (space reserved on 2).\\n ]\\n\\n #only(2,3)[\\n Content included on subslides 2 and 3\\n (no space reserved on 1).\\n ]\\n\\n Content always visible.\\n]\\n
\\nContrary to pause
, the uncover
and only
functions also work in math mode:
#slide[\\n = Dynamic equation\\n\\n $\\n f(x) &= x^2 + 2x + 1 \\\\\\n #uncover(2, $&= (x + 1)^2$)\\n $\\n]\\n
\\nWhen mixing pause
with uncover
/only
, the sequence of pauses should be taken as reference for the meaning of subslide indices. For example content after the first pause always appears on the second subslide, even if it\'s preceded by a call to #uncover(from: 3)[...]
.
The package also works well with pinit:
\\n#import \\"@preview/pinit:0.1.4\\": *\\n\\n#slide[\\n = Works well with `pinit`\\n\\n Pythagorean theorem:\\n\\n $ #pin(1)a^2#pin(2) + #pin(3)b^2#pin(4) = #pin(5)c^2#pin(6) $\\n\\n #show: pause\\n\\n $a^2$ and $b^2$ : squares of triangle legs\\n\\n #only(2, {\\n pinit-highlight(1,2)\\n pinit-highlight(3,4)\\n })\\n\\n #show: pause\\n\\n $c^2$ : square of hypotenuse\\n\\n #pinit-highlight(5,6, fill: green.transparentize(80%))\\n #pinit-point-from(6)[larger than $a^2$ and $b^2$]\\n]\\n
\\nminideck can make a handout version of the document, in which dynamic behavior is disabled: the content of all subslides is shown together in a single slide.
\\nTo compile a handout version, pass --input handout=true
in the command line:
typst compile --input handout=true myfile.typ\\n
\\nIt is also possible to enable handout mode from within the document, as shown in the next section.
\\nThe behavior of the minideck functions depends on the settings passed to minideck.config
. For example, handout mode can also be enabled like this:
#import \\"@preview/minideck:0.2.1\\"\\n\\n#let (template, slide, pause) = minideck.config(handout: true)\\n#show: template\\n\\n#slide[\\n = Slide title\\n \\n Some text\\n\\n #show: pause\\n\\n More text\\n]\\n
\\n(The default value of handout
is auto
, in which case minideck checks for a command line setting as in the previous section.)
minideck.config
accepts the following named arguments:
paper
: a string for one of the paper size names recognized by page.paper
, or one of the shorthands \\"16:9\\"
or \\"4:3\\"
. Default: \\"4:3\\"
.landscape
: use the paper size in landscape orientation. Default: true
.width
: page width as an absolute length. Takes precedence over paper
and landscape
.height
: page height as an absolute length. Takes precedence over paper
and landscape
.handout
: whether to make a document for handout, with content of all subslides shown together in a single slide.theme
: the theme (see below).cetz
: the CeTZ module (see below).fletcher
: the fletcher module (see below).For example to make slides with 16:9 aspect ratio, use minideck.config(paper: \\"16:9\\")
.
Use minideck.config(theme: ...)
to select a theme. Currently there is only one built-in: minideck.themes.simple
. However you can also pass a theme implemented by yourself or from a third-party package. See the theme documentation for how that works.
Themes are functions and can be configured using the standard with
method:
simple
theme has a variant
setting with values \\"light\\" (default) and \\"dark\\".Here\'s an example:
\\n#import \\"@preview/minideck:0.2.1\\"\\n\\n#let (template, slide) = minideck.config(\\n theme: minideck.themes.simple.with(variant: \\"dark\\"),\\n)\\n#show: template\\n\\n#slide[\\n = Slide with dark theme\\n \\n Some text\\n]\\n
\\nNote that you can override part of a theme with show and set rules:
\\n#import \\"@preview/minideck:0.2.1\\"\\n\\n#let (template, slide) = minideck.config(\\n theme: minideck.themes.simple.with(variant: \\"dark\\"),\\n)\\n#show: template\\n\\n#set page(footer: none) // get rid of the page number\\n#show heading: it => text(style: \\"italic\\", it)\\n#set text(red)\\n\\n#slide[\\n = Slide with dark theme and red text\\n \\n Some text\\n]\\n
\\nYou can use uncover
and only
(but not pause
) in CeTZ figures, with the following extra steps:
Get CeTZ-specific functions cetz-uncover
and cetz-only
by passing the CeTZ module to minideck.config
(see example below).
This ensures that minideck uses CeTZ functions from the correct version of CeTZ.
\\nAdd a context
keyword outside the canvas
call.
This is required to access the minideck subslide state from within the canvas without making the content opaque (CeTZ needs to inspect the canvas content to make the drawing).
\\nExample:
\\n#import \\"@preview/cetz:0.2.2\\" as cetz: *\\n#import \\"@preview/minideck:0.2.1\\"\\n\\n#let (template, slide, only, cetz-uncover, cetz-only) = minideck.config(cetz: cetz)\\n#show: template\\n\\n#slide[\\n = In a CeTZ figure\\n\\n Above canvas\\n #context canvas({\\n import draw: *\\n cetz-only(3, rect((0,-2), (14,4), stroke: 3pt))\\n cetz-uncover(from: 2, rect((0,-2), (16,2), stroke: blue+3pt))\\n content((8,0), box(stroke: red+3pt, inset: 1em)[\\n A typst box #only(2)[on 2nd subslide]\\n ])\\n })\\n Below canvas\\n]\\n
\\nThe same steps are required as for CeTZ integration (passing the fletcher module to get fletcher-specific functions), plus an additional step:
\\nGive explicitly the number of subslides to the slide
function.
This is required because I could not find a reliable way to update a typst state from within a fletcher diagram, so I cannot rely on the state to keep track of the number of subslides.
\\nExample:
\\n#import \\"@preview/fletcher:0.5.0\\" as fletcher: diagram, node, edge\\n#import \\"@preview/minideck:0.2.1\\"\\n#let (template, slide, fletcher-uncover) = minideck.config(fletcher: fletcher)\\n#show: template\\n\\n#slide(steps: 2)[\\n = In a fletcher diagram\\n\\n #set align(center)\\n\\n Above diagram\\n\\n #context diagram(\\n node-stroke: 1pt,\\n node((0,0), [Start], corner-radius: 2pt, extrude: (0, 3)),\\n edge(\\"-|>\\"),\\n node((1,0), align(center)[A]),\\n fletcher-uncover(from: 2, edge(\\"d,r,u,l\\", \\"-|>\\", [x], label-pos: 0.1))\\n )\\n \\n Below diagram\\n]\\n
\\nPerformance: minideck is currently faster than Polylux when using pause
, especially for incremental compilation, but a bit slower than Touying, according to my tests.
Features: Polylux and Touying have more themes and more features, for example support for pdfpc which provides speaker notes and more. Minideck allows using uncover
and only
in CeTZ figures and fletcher diagrams, which Polylux currently doesn\'t support.
Syntax: package configuration is simpler in minideck than Touying but a bit more involved than in Polylux. The minideck pause
is more cumbersome to use: one must write #show: pause
instead of #pause
. On the other hand minideck\'s uncover
and only
can be used directly in equations without requiring a special math environment as in Touying (I think).
Other: minideck sometimes has better error messages than Touying due to implementation differences: the minideck stack trace points back to the user\'s code while Touying errors sometimes point only to an output page number.
\\npause
, uncover
and only
work in enumerations but they require explicit enum indices (1. ...
rather than + ...
) as they cause a reset of the list index.context
keyword in front of the canvas
/diagram
call (see above).pause
doesn\'t work in CeTZ figures, fletcher diagrams and math mode.pause
requires writing #show: pause
and its effect is lost after the #show
call goes out of scope. For example this means that one can use pause
inside of a grid, but further pause
calls after the grid (in the same slide) won\'t work as intended.The package uses states with the following keys:
\\n__minideck-subslide-count
: an array of two integers for counting pauses and keeping track of the subslide number automatically. The first value is the number of subslides so far referenced in current slide. The second value is the number of pauses seen so far in the current slide. Both values are kept in one state so that an update function can update the number of subslides based on the number of pauses, without requiring a context. This avoids problems with layout convergence.
__minideck-subslide-step
: the current subslide being generated while processing a slide.
A Typst template for VUW programme descriptions. To get started:
\\ntypst init @preview/tuhi-booklet-vuw:0.1.0\\n
\\nAnd edit the main.typ
example.
PRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.
\\n","description":"A Typst template for VUW programme descriptions. To get started: typst init @preview/tuhi-booklet-vuw:0.1.0\\n\\n\\nAnd edit the main.typ example.\\n\\nContributing\\n\\nPRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.","guid":"https://typst.app/universe/package/tuhi-booklet-vuw","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-01T08:57:28.762Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/tuhi-booklet-vuw/0.1.0/thumbnail.png","type":"photo","width":1654,"height":2339}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"cineca (0.2.1) | A package to create calendar with events.","url":"https://typst.app/universe/package/cineca","content":"CINECA Is Not an Electric Calendar App, but a Typst package to create calendars with events.
\\ncalendar(events, hour-range, minute-height, template, stroke)
Parameters:
\\nevents
: An array of events. Each item is a 4-element array:\\nhour-range
: Then range of hours, affacting the range of the calendar. Default: (8, 20)
.minute-height
: Height of per minute. Each minute occupys a row. This number is to control the height of each row. Default: 0.8pt
.template
: Templates for headers, times, or events. It takes a dictionary of the following entries: header
, time
, and event
. Default: (:)
.stroke
: A stroke style to control the style of the default stroke, or a function taking two parameters (x, y)
to control the stroke. The first row is the dates, and the first column is the times. Default: none
.\\n\\nFloat-style time means a number representing 24-hour time. The integer part represents the hour. The fractional part represents the minute.
\\n
Example:
\\ncalendar-month(events, template, sunday-first, ..args)
events
: Event list. Each element is a two-element array.\\nday-body
. For the deafult template, it requires a content.template
: Templates for headers, times, or events. It takes a dictionary of the following entries: day-body
, day-head
, month-head
, and layout
.sunday-first
: Whether to put sunday as the first day of a week...args
: Additional arguments for the calendar\'s grid.Example:
\\n#let events = (\\n (datetime(year: 2024, month: 2, day: 1, hour: 9, minute: 0, second: 0), [Lecture]),\\n (datetime(year: 2024, month: 2, day: 1, hour: 10, minute: 0, second: 0), [Tutorial]),\\n (datetime(year: 2024, month: 2, day: 2, hour: 10, minute: 0, second: 0), [Meeting]),\\n (datetime(year: 2024, month: 2, day: 10, hour: 12, minute: 0, second: 0), [Lunch]),\\n (datetime(year: 2024, month: 2, day: 25, hour: 8, minute: 0, second: 0), [Train]),\\n)\\n\\n#calendar-month(\\n events,\\n sunday-first: false,\\n template: (\\n month-head: (content) => strong(content)\\n )\\n)\\n
\\n#let events2 = (\\n (datetime(year: 2024, month: 5, day: 1, hour: 9, minute: 0, second: 0), ([Lecture], blue)),\\n (datetime(year: 2024, month: 5, day: 1, hour: 10, minute: 0, second: 0), ([Tutorial], red)),\\n (datetime(year: 2024, month: 5, day: 1, hour: 11, minute: 0, second: 0), [Lab]),\\n)\\n\\n#calendar-month(\\n events2,\\n sunday-first: true,\\n rows: (2em,) * 2 + (8em,),\\n template: (\\n day-body: (day, events) => {\\n show: block.with(width: 100%, height: 100%, inset: 2pt)\\n set align(left + top)\\n stack(\\n spacing: 2pt,\\n pad(bottom: 4pt, text(weight: \\"bold\\", day.display(\\"[day]\\"))),\\n ..events.map(((d, e)) => {\\n let col = if type(e) == array and e.len() > 1 { e.at(1) } else { yellow }\\n show: block.with(\\n fill: col.lighten(40%),\\n stroke: col,\\n width: 100%,\\n inset: 2pt,\\n radius: 2pt\\n )\\n d.display(\\"[hour]\\")\\n h(4pt)\\n if type(e) == array { e.at(0) } else { e }\\n })\\n )\\n }\\n )\\n)\\n
\\ncalendar-month-summary(events, template, sunday-first, ..args)
events
: Event list. Each element is a two-element array.\\nday-body
. For the deafult template, it requires an array of two elements.\\ncircle
.template
: Templates for headers, times, or events. It takes a dictionary of the following entries: day-body
, day-head
, month-head
, and layout
.sunday-first
: Whether to put sunday as the first day of a week...args
: Additional arguments for the calendar\'s grid.Example:
\\n#let events = (\\n (datetime(year: 2024, month: 02, day: 21), (circle, (stroke: color.green, inset: 2pt))),\\n (datetime(year: 2024, month: 02, day: 22), (circle, (stroke: color.green, inset: 2pt))),\\n (datetime(year: 2024, month: 05, day: 27), (circle, (stroke: color.green, inset: 2pt))),\\n (datetime(year: 2024, month: 05, day: 28), (circle, (stroke: color.blue, inset: 2pt))),\\n (datetime(year: 2024, month: 05, day: 29), (circle, (stroke: color.blue, inset: 2pt))),\\n (datetime(year: 2024, month: 06, day: 03), (circle, (stroke: color.blue, inset: 2pt))),\\n (datetime(year: 2024, month: 06, day: 04), (circle, (stroke: color.yellow, inset: 2pt))),\\n (datetime(year: 2024, month: 06, day: 05), (circle, (stroke: color.yellow, inset: 2pt))),\\n (datetime(year: 2024, month: 06, day: 10), (circle, (stroke: color.red, inset: 2pt))),\\n)\\n\\n#calendar-month-summary(\\n events: events\\n)\\n\\n#calendar-month-summary(\\n events: events,\\n sunday-first: true\\n)\\n\\n// An empty calendar\\n#calendar-month-summary(\\n events: (\\n (datetime(year: 2024, month: 05, day: 21), (none,)),\\n ),\\n stroke: 1pt,\\n)\\n
\\nA package that helps you to specify different numbering formats for different levels of headings.
\\nSuppose you want to specify the following numbering format for your document:
\\nYou might use if
to achieve this:
#set heading(numbering: (..nums) => {\\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
\\nBut with numbly
, you can do this more easily:
#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","description":"A package that helps you to specify different numbering formats for different levels of headings. Suppose you want to specify the following numbering format for your document:\\n\\nAppendix A. Guide\\nA.1. Installation\\nStep 1. Download\\nStep 2. Install\\nA.2. Usage\\n\\nYou might use i…","guid":"https://typst.app/universe/package/numbly","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-07-01T08:37:28.478Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"paddling-tongji-thesis (0.1.1) | 同济大学本科生毕业设计论文模板 | Tongji University Undergraduate Thesis Template","url":"https://typst.app/universe/package/paddling-tongji-thesis","content":"中文 | English
\\n\\n\\n[!CAUTION]\\n由于 Typst 项目仍处于密集发展阶段,且对某些功能的支持不完善,因此本模板可能存在一些问题。如果您在使用过程中遇到了问题,欢迎提交 issue 或 PR,我们会尽力解决。
\\n在此期间,欢迎大家使用我们的 LaTeX 模板。
\\n
以下依次展示 “封面”、“中文摘要”、“目录”、“主要内容”、“参考文献” 与 “谢辞”。
\\n\\n \\n
\\n
\\n
\\n
\\n
\\n
或在 Typst Web App 中选择 Start from a template
,然后选择 paddling-tongji-thesis
。
从fonts
分支下载所有字体文件,上传到该项目的根目录。即可开始使用。
参照 Typst 官方文档安装 Typst。
\\n从fonts
分支下载所有字体文件,并安装到系统中。
typst
初始化typst init @preview/paddling-tongji-thesis\\n
\\ntypst compile main.typ\\n
\\ngit clone
初始化git clone https://github.com/TJ-CSCCG/tongji-undergrad-thesis-typst.git\\ncd tongji-undergrad-thesis-typst\\n
\\ntypst compile init-files/main.typ --root .\\n
\\n\\n\\n[!TIP]\\n若你不想把项目使用的字体安装到系统中,可以在编译时指定字体路径,例如:
\\n\\ntypst compile init-files/main.typ --root . --font-path {YOUR_FONT_PATH}\\n
还请查看 How to pull request。
\\n该项目使用 MIT License 开源协议。
\\n本项目使用了方正字库中的字体,版权归方正字库所有。本项目仅用于学习交流,不得用于商业用途。
\\n我们非常感谢以上贡献者的付出,他们的工作为更多同学提供了方便和帮助。
\\n在使用本模板时,如果您觉得本项目对您的毕业设计或论文有所帮助,我们希望您可以在您的致谢部分感谢并致以敬意。
\\n我们从顶尖高校的优秀开源项目中学到了很多:
\\n\\n# Python\\n[\\n \'rizhonglin@$.%\'.replace(\'$\', \'epfl\').replace(\'%\', \'ch\'),\\n]\\n
\\n1013806782
This is a package for writing pseudocode in Typst.\\nIt is named after the computer science pioneer\\nAda Lovelace and inspired by the\\npseudo package for LaTeX.
\\n\\n
\\n
Pseudocode is not a programming language, it doesn\'t have strict syntax, so\\nyou should be able to write it however you need to in your specific situation.\\nLovelace lets you do exactly that.
\\nMain features include:
\\nImport the package using
\\n#import \\"@preview/lovelace:0.3.0\\": *\\n
\\nThe simplest usage is via pseudocode-list
which transforms a nested list\\ninto pseudocode:
#pseudocode-list[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n + *end*\\n + *end*\\n]\\n
\\nresulting in:
\\nAs you can see, every list item becomes one line of code and nested lists become\\nindented blocks.\\nThere are no special commands for common keywords and control structures, you\\njust use whatever you like.
\\nMaybe in your domain very uncommon structures make more sense?\\nNo problem!
\\n#pseudocode-list[\\n + *in parallel for each* $i = 1, ..., n$ *do*\\n + fetch chunk of data $i$\\n + *with probability* $exp(-epsilon_i slash k T)$ *do*\\n + perform update\\n + *end*\\n + *end*\\n]\\n
\\nIf you feel uncomfortable with abusing Typst\'s lists like we do here, you can\\nalso use the pseudocode
function directly:
#pseudocode(\\n [do something],\\n [do something else],\\n [*while* still something to do],\\n indent(\\n [do even more],\\n [*if* not done yet *then*],\\n indent(\\n [wait a bit],\\n [resume working],\\n ),\\n [*else*],\\n indent(\\n [go home],\\n ),\\n [*end*],\\n ),\\n [*end*],\\n)\\n
\\nThis is equivalent to the first example.\\nNote that each line is given as one content argument and you indent a block by\\nusing the indent
function.
This approach has the advantage that you do not rely on significant whitespace\\nand code formatters can automatically correctly indent your Typst code.
\\nLovelace puts a number in front of each line by default.\\nIf you want no numbers at all, you can set the line-numbering
option to\\nnone
.\\nThe initial example then looks like this:
#pseudocode-list(line-numbering: none)[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n + *end*\\n + *end*\\n]\\n
\\n(You can also pass this keyword argument to pseudocode
.)
If you do want line numbers in general but need to turn them off for specific\\nlines, you can use -
items instead of +
items in pseudocode-list
:
#pseudocode-list[\\n + normal line with a number\\n - this line has no number\\n + this one has a number again\\n]\\n
\\nIt\'s easy to remember:\\n-
items usually produce unnumbered lists and +
items produce numbered lists!
When using the pseudocode
function, you can achieve the same using\\nno-number
:
#pseudocode(\\n [normal line with a number],\\n no-number[this line has no number],\\n [this one has a number again],\\n)\\n
\\nOther than none
, you can assign anything listed\\nhere\\nto line-numbering
.
So maybe you happen to think about the Roman Empire a lot and want to reflect\\nthat in your pseudocode?
\\n#set text(font: \\"Cinzel\\")\\n\\n#pseudocode-list(line-numbering: \\"I:\\")[\\n + explore European tribes\\n + *while* not all tribes conquered\\n + *for each* tribe *in* unconquered tribes\\n + try to conquer tribe\\n + *end*\\n + *end*\\n]\\n
\\nYou can reference an inividual line of a pseudocode by giving it a label.\\nInside pseudocode-list
, you can use line-label
:
#pseudocode-list[\\n + #line-label(<start>) do something\\n + #line-label(<important>) do something important\\n + go back to @start\\n]\\n\\nThe relevance of the step in @important cannot be overstated.\\n
\\nWhen using pseudocode
, you can use with-line-label
:
#pseudocode(\\n with-line-label(<start>)[do something],\\n with-line-label(<important>)[do something important],\\n [go back to @start],\\n)\\n\\nThe relevance of the step in @important cannot be overstated.\\n
\\nThis has the same effect as the previous example.
\\nThe number shown in the reference uses the numbering scheme defined in the\\nline-numbering
option (see previous section).
By default, \\"Line\\"
is used as the supplement for referencing lines.\\nYou can change that using the line-number-supplement
option to pseudocode
\\nor pseudocode-list
.
By default, Lovelace puts a thin gray (gray + 1pt
) line to the left of each\\nindented block, which guides the reader in understanding the indentations, just\\nlike a code editor would.\\nYou can customise this using the stroke
option which takes any value that is\\na valid Typst stroke.\\nYou can especially set it to none
to have no indentation guides.
The example from the beginning becomes:
\\n#pseudocode-list(stroke: none)[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n + *end*\\n + *end*\\n]\\n
\\nSome people prefer using the indentation guide to signal the end of a block\\ninstead of writing something like \\"end\\" by having a small \\"hook\\" at the end.\\nTo achieve that in Lovelace, you can make use of the hook
option and specify\\nhow far a line should extend to the right from the indentation guide:
#pseudocode-list(hooks: .5em)[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n]\\n
\\nYou can control how far indented lines are shifted right by the indentation
\\noption.\\nTo change the space between lines, use the line-gap
option.
#pseudocode-list(indentation: 3em, line-gap: 1.5em)[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n + *end*\\n + *end*\\n]\\n
\\nYou can also add a title and/or a frame around your algorithm if you like:
\\nUsing the title
option, you can give your pseudocode a title (surprise!).\\nFor example, to achieve\\nCLRS style,\\nyou can do something like
#pseudocode-list(stroke: none, title: smallcaps[Fancy-Algorithm])[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n + *end*\\n + *end*\\n]\\n
\\nIf you like wrapping your algorithm in elegant horizontal lines, you can do so\\nby setting the booktabs
option to true
.
#pseudocode-list(booktabs: true)[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n + *end*\\n + *end*\\n]\\n
\\nTogether with the title
option, you can produce
#pseudocode-list(booktabs: true, title: [My cool title])[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n + *end*\\n + *end*\\n]\\n
\\nBy default, the outer booktab strokes are black + 2pt
.\\nYou can change that with the option booktabs-stroke
to any valid\\nTypst stroke.\\nThe inner line will always have the same stroke as the outer ones, just with\\nhalf the thickness.
To make algorithms referencable and being able to float in the document,\\nyou can use Typst\'s figure
function with a custom kind
.
#figure(\\n kind: \\"algorithm\\",\\n supplement: [Algorithm],\\n caption: [My cool algorithm],\\n\\n pseudocode-list[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n + *end*\\n + *end*\\n ]\\n)\\n
\\nIf you want to have the algorithm counter inside the title instead (see previous\\nsection), there is the option numbered-title
:
#figure(\\n kind: \\"algorithm\\",\\n supplement: [Algorithm],\\n\\n pseudocode-list(booktabs: true, numbered-title: [My cool algorithm])[\\n + do something\\n + do something else\\n + *while* still something to do\\n + do even more\\n + *if* not done yet *then*\\n + wait a bit\\n + resume working\\n + *else*\\n + go home\\n + *end*\\n + *end*\\n ]\\n) <cool>\\n\\nSee @cool for details on how to do something cool.\\n
\\nNote that the numbered-title
option only makes sense when nesting your\\npseudocode inside a figure with kind: \\"algorithm\\"
, otherwise it produces\\nundefined results.
Both pseudocode
and pseudocode-list
accept the following configuration\\narguments:
option | type | default\\n--- | --- | ---\\nline-numbering
| none
or a numbering | \\"1\\"
\\nline-number-supplement
| content | \\"Line\\"
\\nstroke
| stroke | 1pt + gray
\\nhooks
| length | 0pt
\\nindentation
| length | 1em
\\nline-gap
| length | .8em
\\nbooktabs
| bool | false
\\nbooktabs-stroke
| stroke | 2pt + black
\\ntitle
| content or none
| none
\\nnumbered-title
| content or none
| none
Until Typst supports user defined types, we can use the following trick when\\nwanting to set own default values for these options.\\nSay, you always want your algorithms to have colons after the line numbers,\\nno indentation guides and, if present, blue booktabs.\\nIn this case, you would put the following at the top of your document:
\\n#let my-lovelace-defaults = (\\n line-numbering: \\"1:\\",\\n stroke: none,\\n booktabs-stroke: 2pt + blue,\\n)\\n\\n#let pseudocode = pseudocode.with(..my-lovelace-defaults)\\n#let pseudocode-list = pseudocode-list.with(..my-lovelace-defaults)\\n
\\nLovelace exports the following functions:
\\npseudocode
: Typeset pseudocode with each line as an individual content\\nargument, see here for details.\\nHas these optional arguments.pseudocode-list
: Takes a standard Typst list and transforms it into a\\npseudocode.\\nHas these optional arguments.indent
: Inside the argument list of pseudocode
, use indent
to specify\\nan indented block, see here for details.no-number
: Wrap an argument to pseudocode
in this function to have the\\ncorresponding line be unnumbered, see here for details.with-line-label
: Use this function in the pseudocode
arguments to add\\na label to a specific line, see here for details.line-label
: When using pseudocode-list
, you do not use with-line-label
\\nbut insert a call to line-label
somewhere in a line to add a label, see\\nhere for details.How to number the heading like this?
\\nOr this?
\\nYou might use a function:
\\n#set heading(numbering: (..nums) => {\\n if nums.pos().len() == 1 {\\n return \\"Appendix \\" + numbering(\\"A.\\", ..nums)\\n }\\n return numbering(\\"A.1.\\", ..nums)\\n}\\n
\\nOr set up a couple of set
rules:
#set heading(numbering: \\"A.1.\\")\\n#show heading.where(level: 1): set heading(numbering: (n) => \\"Appendix \\" + numbering(\\"A.\\", n))\\n// No, you can\'t use \\"Appendix A.\\" since Typst would treat the first \\"A\\" as a numbering\\n
\\nOr simply use Numblex:
\\n#import \\"@preview/numblex:0.2.0\\": numblex\\n\\n#set heading(numbering: numblex(\\"{Appendix [A].:d==1;[A].}{[1].}\\"))\\n
\\n#import \\"@preview/numblex:0.2.0\\": numblex\\n\\n#set heading(numbering: numblex(\\"{Section [A].:d==1;[A].}{[1].}{[1])}\\"))\\n\\n
\\nYou can read the Manual for more information.
\\n","description":"How to number the heading like this? Appendix A. XXXX\\nA.1. YYY\\nA.2. ZZZ\\n\\nOr this?\\n\\n一、话题\\n1. 论点\\n(1) 证据\\n\\nYou might use a function:\\n\\n#set heading(numbering: (..nums) => {\\n if nums.pos().len() == 1 {\\n return \\"Appendix \\" + numbering(\\"A.\\", ..nums)\\n }\\n return numbering(\\"A…","guid":"https://typst.app/universe/package/numblex","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-24T08:35:21.631Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"iridis (0.1.0) | A package to colors matching parenthesis","url":"https://typst.app/universe/package/iridis","content":"Iridis is a package to colorize parenthesis in your typst document. Iridis is a latin word that means \\"rainbow\\". This package is inspired by the many rainbow parenthesis plugins available for code editors.
\\nThe package provides a single show-rule iridis-show
that can be used to colorize parenthesis in your document and a palette iridis-palette
that can be used to define the colors used.
The rule takes 3 arguments:
\\nopening-parenthesis
: The opening parenthesis character. Default is (\\"(\\", \\"[\\", \\"{\\")
.closing-parenthesis
: The closing parenthesis character. Default is (\\")\\", \\"]\\", \\"}\\")
.palette
: The color palette to use. Default is iridis-palette
.If the symbols are single characters, they are interpreted as normal strings but if you use multi-character strings, then they are interpreted as regular expressions.
\\n#show: iridis.iridis-show\\n\\n```rs\\nfn main() {\\n let n = false;\\n if n {\\n println!(\\"Hello, world!\\");\\n } else {\\n println!(\\"Goodbye, world!\\");\\n }\\n}\\n```\\n\\n```cpp\\n#include <iostream>\\n\\nint main() {\\n bool n = false;\\n if (n) {\\n std::cout << \\"Hello, world!\\" << std::endl;\\n } else {\\n std::cout << \\"Goodbye, world!\\" << std::endl;\\n }\\n}\\n```\\n\\n```py\\nif __name__ == \\"__main__\\":\\n n = False\\n if n:\\n print(\\"Hello, world!\\")\\n else:\\n print(\\"Goodbye, world!\\")\\n```\\n
\\n#show: iridis.iridis-show\\n\\n$\\n \\"plus\\" equiv lambda m. f lambda n. lambda f. lambda x. m f (n f x) \\\\\\n \\"succ\\" equiv lambda n. lambda f. lambda x. f (n f x) \\\\\\n \\"mult\\" equiv lambda m. lambda n. lambda f. lambda x. m (n f) x \\\\\\n \\"pred\\" equiv lambda n. lambda f. lambda x. n (lambda g. lambda h. h (g f)) (lambda u. x) (lambda u. u) \\\\\\n \\"zero\\" equiv lambda f. lambda x. x \\\\\\n \\"one\\" equiv lambda f. lambda x. f x \\\\\\n \\"two\\" equiv lambda f. lambda x. f (f x) \\\\\\n \\"three\\" equiv lambda f. lambda x. f (f (f x)) \\\\\\n \\"four\\" equiv lambda f. lambda x. f (f (f (f x))) \\\\\\n$\\n\\n$\\n (((1 + 5) * 7) / (5 - 8 * 7) + 3) * 2 approx 4.352941176\\n$\\n\\n$ mat(\\n 1, 2, ..., (10 / 2);\\n 2, 2, ..., 10;\\n dots.v, dots.v, dots.down, dots.v;\\n 10, (10 - (5 * 8)) / 2, ..., 10;\\n) $\\n
\\nThis is a Typst template for a two-column paper in a style similar to that of the Royal Society of Chemistry.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the dashboard and searching for the chimicoms-paper
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/chemicoms-paper\\n
\\nThis template exports the template
function with the following named arguments:
title
(optional, content)subtitle
(optional, content)short-title
(optional, string)author(s)
(optional, (array or singular) dictionary or string)\\nname
(required, string, inferred)url
(optional, string)phone
(optional, string)fax
(optional, string)orcid
(optional, string)note
(optional, string)email
(optional, string)corresponding
(optional, boolean, default true if email set)equal-contributor
(optional, boolean)deceased
(optional, boolean)roles
(optional, (array or singular) string)affiliation(s)
(optional, (array or singular) dictionary or strng)\\nabstract(s)
(optional, (array or singular) dictionary or content)\\ntitle
(default: \\"Abstract\\")content
(required, content, inferred)open-access
(optional, boolean)venue
(optional, content)doi
(optional, string)keywords
(optional, array of strings)dates
(optional, (array or singular) dictionary or date)\\ntype
(optional, content)date
(required, date or string, inferred)The functions also accepts a single, positional argument for the body of the paper.
\\n\\n \\n \\n
\\n
Provides functions #nth()
and #nths()
which take a number and return it suffixed by an english ordinal.
This package is named after the nth LaTeX macro by Donald Arseneau.
\\nInclude this line in your document to import the package.
\\n#import \\"@preview/nth:1.0.1\\": *\\n
\\nThen, you can use #nth()
to markup ordinal numbers in your document.
For example, #nth(1)
shows 1st,
\\n#nth(2)
shows 2nd,
\\n#nth(3)
shows 3rd,
\\n#nth(4)
shows 4th,
\\nand #nth(11)
shows 11th.
If you want the ordinal to be in superscript, use #nths
with an \'s\' at the end.
For example, #nths(1)
shows 1st.
适用于哈尔滨工业大学学位论文的 Typst 模板
\\n\\n\\n[!WARNING]\\n本模板正处于积极开发阶段,存在一些格式问题,适合尝鲜 Typst 特性
\\n本模板是民间模板,可能不被学校认可,正式使用过程中请做好随时将内容迁移至 Word 或 LaTeX 的准备
\\n
Typst 是使用 Rust 语言开发的全新文档排版系统,有望以 Markdown 级别的简洁语法和编译速度实现 LaTeX 级别的排版能力,即通过编写遵循 Typst 语法规则的文本文档、执行编译命令,来可生成目标格式的 PDF 文档。
\\nHIT Thesis Typst 是一套简单易用的哈尔滨工业大学学位论文 Typst 模板,受 hithesis 启发,计划囊括一校三区本科、硕士、博士的学位论文格式。
\\n预览效果
\\n这种方式适合大多数用户。
\\n首先安装 Typst,您可以在 Typst Github 仓库的 Release 页面 下载最新的安装包直接安装,并将 typst
可执行程序添加到 PATH
环境变量;如果您使用 Scoop 包管理器,则可以直接通过 scoop install typst
命令安装。
安装好 Typst 之后,您只需要选择一个您喜欢的目录,并在此目录下执行以下命令:
\\ntypst init @preview/universal-hit-thesis:0.2.1\\n
\\nTypst 将会创建一个名为 universal-hit-thesis
的文件夹,进入该目录后,您可以直接修改目录下的 universal-bachelor.typ
,然后执行以下命令进行编译生成 .pdf
文档:
typst compile universal-bachelor.typ\\n
\\n或者使用以下命令进行实时预览:
\\ntypst watch universal-bachelor.typ\\n
\\n当您要实时预览时,我们更推荐使用 Visual Studio Code 进行编辑,配合 Tinymist Typst, Typst Preview 等插件可以大幅提升您的编辑体验。
\\n这种方法适合 Typst 开发者。
\\n首先使用 git clone
命令 clone 本项目,或者直接在 Release 页面下载特定版本的源码。在 templates/
目录下选择您需要的模板,直接修改或复制一份,在根目录运行以下命令进行编译:
typst compile ./templates/<template-name>.typ --root ./\\n
\\n或者使用如下命令进行实时预览:
\\ntypst watch ./templates/<template-name>.typ --root ./\\n
\\n\\n\\n[!TIP]\\n本模板正处于积极开发阶段,更新较为频繁,虽然已经上传至 Typst Universe,但是您依然可以借助 Typst local packages 来实现在 Typst Universe 同步本模板的最新版本前,在本地体验本模板的最新版本,具体做法为:
\\n\\n
\\n- \\n
\\n在 Release 页面下载对应版本的源码压缩包,并将其解压到
\\n{data-dir}/typst/packages/local/universal-hit-thesis/{version}
,{data-dir}
在不同操作系统下的值为:\\n
\\n- \\n
$XDG_DATA_HOME
or~/.local/share
on Linux- \\n
~/Library/Application
Support on macOS- \\n
%LOCALAPPDATA%
on Windows\\n
{version}
的值为typst.toml
中version
项的值.解压完成后
\\ntypst.toml
文件应该出现在{data-dir}/typst/packages/local/universal-hit-thesis/{version}
目录下.- \\n
\\n接着您需要在您的论文中将
\\n#import \\"@preview/universal-hit-thesis:0.2.1\\"
修改为#import \\"@local/universal-hit-thesis:{version}\\"
,即可更新模板.
本模板已上传 Typst Universe,您可以使用 Typst 的官方 Web App 进行编辑。
\\n具体来说,在 Typst Web App 登录后,点击 Start from template
,在弹出的窗口中选择 universal-hit-thesis
,即可从模板创建项目。
\\n\\n[!NOTE]
\\nTypst Web App 的排版渲染在浏览器本地执行,所以实时预览体验几乎与在本地编辑无异。
\\n默认情况下,当您在 Web App 使用模板创建论文项目后,可能在项目中看到大量针对中文文本的拼写错误警告,您可以通过在
\\n#cover()
函数调用点前插入语句#set text(lang: \\"zh\\")
来消除这些警告,该问题将在未来的版本中得到修复.此外您可能已经注意到,Web App 中的模板字体显示与预期存在差距,这是因为 Web App 默认不提供
\\nSimSun
,Times New Roman
等中文排版常用字体。为了解决这个问题,您可以在搜索引擎搜索以下字体文件:\\n
\\n- \\n
TimesNewRoman.ttf
(包括Bold
,Italic
Bold-Italic
等版本)- \\n
SimSun.ttf
- \\n
SimHei.ttf
- \\n
Kaiti.ttf
- \\n
Consolas.ttf
- \\n
Courier New.ttf
并将这些文件手动上传至 Web App 项目根目录中,或为了目录整洁,可以创建一个
\\nfonts
文件夹并将字体置于其中,Typst Web App 将自动加载这些字体,并正确渲染到预览窗口中.由于每次在 Typst Web App 中打开项目时都需要重新下载字体,而中文字体体积普遍较大,加载时间较长,因此我们更推荐本地编辑。
\\n
\\n\\n[!NOTE]\\n注意到,官方提供的本科毕业设计 Microsoft Word 论文模板
\\n本科毕业论文(设计)书写范例(理工类).doc
在一校三区是通用的,意味着本 Typst 模板的本科论文部分理论上也是在一校三区通用的,因此我们提供适用于各校区的本科毕业论文模板模块导出,即以下四种导入模块的方式效果相同:\\n#import \\"@preview/universal-hit-thesis:0.2.1\\": harbin-bachelor\\n#import harbin-bachelor: * // 哈尔滨校区本科\\n
\\n#import \\"@preview/universal-hit-thesis:0.2.1\\": weihai-bachelor\\n#import weihai-bachelor: * // 威海校区本科\\n
\\n#import \\"@preview/universal-hit-thesis:0.2.1\\": shenzhen-bachelor\\n#import shenzhen-bachelor: * // 深圳校区本科\\n
\\n#import \\"@preview/universal-hit-thesis:0.2.1\\": universal-bachelor\\n#import universal-bachelor: * // 一校三区本科通用\\n
若要书写和引用伪代码,您可以使用 algorithm-figure
,为此,您需要导入 algorithmic
或 lovelace
包。
#import \\"@preview/algorithmic:0.1.0\\"\\n#import algorithmic: algorithm\\n\\n#import \\"@preview/lovelace:0.2.0\\": *\\n
\\n使用方式详见模板中的伪代码
节
尽管本 Typst 模板各部分字体、字号等设置均与原 Word 模板一致,但段落排版视觉上仍与 Word 模板有一些差别,这与字符间距、行距、段落间距有一定肉眼排版成分有关.
\\nGB/T 7714-2015 numeric
格式存在差异,我们已修改相关 CSL 文件并形成 gb-t-7714-2015-numeric-hit.csl
以修复作者名字大小写等问题,但仍有以下已知特性尚未支持:\\nschool
等字段.km
Draw simple Karnaugh maps. Use with:
\\n#import \\"@preview/km:0.1.0\\": karnaugh\\n\\n#karnaugh((\\"C\\", \\"AB\\"),\\n implicants: (\\n (0, 1, 1, 2),\\n (1, 2, 2, 1),\\n ),\\n (\\n (0, 1, 0, 0),\\n (0, 1, 1, 1),\\n )\\n)\\n
\\nSamples are available in sample.pdf
.
Get LaTeX-like delimeter sizing in Typst!
\\n#import \\"@preview/embiggen:0.0.1\\": *\\n\\n= embiggen\\n\\nHere\'s an equation of sorts:\\n\\n$ {lr(1/2x^2|)^(x=n)_(x=0) + (2x+3)} $\\n\\nAnd here are some bigger versions of it:\\n\\n$ {big(1/2x^2|)^(x=n)_(x=0) + big((2x+3))} $\\n$ {Big(1/2x^2|)^(x=n)_(x=0) + Big((2x+3))} $\\n$ {bigg(1/2x^2|)^(x=n)_(x=0) + bigg((2x+3))} $\\n$ {Bigg(1/2x^2|)^(x=n)_(x=0) + Bigg((2x+3))} $\\n\\nAnd now, some smaller versions (#text([#link(\\"https://x.com/tsoding/status/1756517251497255167\\", \\"cAn YoUr LaTeX dO tHaT?\\")], fill: rgb(50, 20, 200), font: \\"Noto Mono\\")):\\n\\n$ small(1/2x^2|)^(x=n)_(x=0) $\\n$ Small(1/2x^2|)^(x=n)_(x=0) $\\n$ smalll(1/2x^2|)^(x=n)_(x=0) $\\n$ Smalll(1/2x^2|)^(x=n)_(x=0) $\\n
\\nApplies a scale factor of 125%
to #lr
pre-determined scale. Delimeters are enlarged by this amount compared to what #lr
would normally do.
Like big(...)
, but applies a scale factor of 156.25%
.
Like big(...)
, but applies a scale factor of 195.313%
.
Like big(...)
, but applies a scale factor of 244.141%
.
Applies a scale factor of 80%
to #lr
pre-determined scale. Delimeters are shrunk by this amount compared to what #lr
would normally do. This does not exist in standard LaTeX, but is necessary in this package because these functions scale the output of #lr
, so delimeter sizes will get larger depending on the content.
Like small(...)
, but applies a scale factor of 64%
.
Like small(...)
, but applies a scale factor of 51.2%
.
Like small(...)
, but applies a scale factor of 40.96%
.
sigfig
sigfig
is a Typst package for rounding numbers with significant figures and measurement uncertainty.
#import \\"@preview/sigfig:0.1.0\\": round, urounds\\n#import \\"@preview/unify:0.5.0\\": num\\n\\n$ #num(round(98654, 3)) $\\n$ #num(round(2.8977729e-3, 4)) $\\n$ #num(round(-.0999, 2)) $\\n$ #num(urounds(114514.19, 1.98)) $\\n$ #num(urounds(1234.5678, 0.096)) $\\n
\\nyields
\\nround
round
is similar to JavaScript\'s Number.prototype.toPrecision()
(ES spec).
#assert(round(114514, 3) == \\"1.15e5\\")\\n#assert(round(1, 5) == \\"1.0000\\")\\n#assert(round(12345, 10) == \\"12345.00000\\")\\n#assert(round(.00000002468, 3) == \\"2.47e-8\\")\\n
\\nNote that what is different from the ES spec is that there will be no sign ($+$) if the exponent after e
is positive.
uround
uround
rounds a number with its uncertainty, and returns a string of both.
#assert(uround(114514, 1919) == \\"1.15e5+-2e3\\")\\n#assert(uround(114514.0, 1.9) == \\"114514+-2\\")\\n
\\nurounds
uround
rounds a number with its uncertainty, and returns a string of both with the same exponent, if any.
You can use num
in unify
to display the result.
MIT © 2024 OverflowCat (overflow.cat).
\\n","description":"sigfig is a Typst package for rounding numbers with significant figures and measurement uncertainty. Overview\\n#import \\"@preview/sigfig:0.1.0\\": round, urounds\\n#import \\"@preview/unify:0.5.0\\": num\\n\\n$ #num(round(98654, 3)) $\\n$ #num(round(2.8977729e-3, 4)) $\\n$ #num(round(-.0999, 2))…","guid":"https://typst.app/universe/package/sigfig","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-17T14:55:33.188Z","media":[{"url":"https://github.com/typst/packages/assets/20166026/f3d69c3c-bc67-484f-81f9-80a10913fd11","type":"photo","width":830,"height":973}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"ccicons (1.0.0) | A port of the ccicon LaTeX package for Typst.","url":"https://typst.app/universe/package/ccicons","content":"\\n\\n[!NOTE]\\n
\\nccicons
is an adaption of the ccicons package for LaTeX by Michael Ummels.
Import the package into your document:
\\n#import \\"@preview/ccicons:1.0.0\\": *\\n
\\nStart using license icons:
\\n#cc-by-nc-sa\\n
\\nSee the the manual for more details and an overview all available Creative Commons icons.
\\nPlease note that all icons that can be typeset using this package are trademarks of Creative Commons and are subject to the Creative Commons trademark policy (see http://creativecommons.org/policies).
\\nThe symbols in this font have been obtained from https://creativecommons.org/mission/downloads/ and released by Creative Commons under a Creative Commons Attribution 4.0 International license: https://creativecommons.org/licenses/by/4.0/
\\n","description":"Creative Commons icons for your Typst documents [!NOTE] ccicons is an adaption of the ccicons package for LaTeX by Michael Ummels.\\n\\nGetting Started\\n\\nImport the package into your document:\\n\\n#import \\"@preview/ccicons:1.0.0\\": *\\n\\n\\nStart using license icons:\\n\\n#cc-by-nc-sa\\n\\n\\nSee the the…","guid":"https://typst.app/universe/package/ccicons","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-17T13:16:24.687Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"isc-hei-report (0.1.5) | An official report template for the \'Informatique et systèmes de communication\' (ISC) bachelor degree programme at the Schoo...","url":"https://typst.app/universe/package/isc-hei-report","content":"\\n
\\n \\n \\n \\n
This is an official template for students reports for the ISC degree programme at the School of engineering in Sion.
\\nIn the Typst
web application, start with the isc-hei-report
and voilà ! Using the CLI, you can initialize the project with the command :
typst init @preview/isc-hei-report:0.1.5\\n
\\nThis template will initialize an sample report with sensible default values.
\\nIf you are running typst
locally, you might miss some of the required fonts. For your convenience, a font download script is included in this repos. As all the fonts are released under the SIL Open Font License, there are no file inclusion issues here.
To the install the fonts locally in a Linux environment, simply type
\\nsource install_fonts.sh\\n
\\nfrom within the fonts
directory.
Unfortunately, typst
does not support PDF file types inclusion at the time of writing this documentation. As a temporary workaround, PDF files can be converted to SVG via pdf2svg
.
When used locally, creating a PDF is straightforward with the command
\\ntypst compile report.typ\\n
\\nEven nicer, the following command compiles the report every time the file is modified.
\\ntypst watch report.typ\\n
\\nAnother nice possibility is of course to use a VScod[e | ium] via the Typst LSP
plugin which enables direct compilation.
In the future, several things might be updated, such as :
\\nIf you need any help for installing or running those tools, do not hesitate to get in touch with its maintainer pmudry.
\\nYou can of course also propose changes using PR or raise issues if something is not clear. Have fun writing reports!
\\n","description":"This is an official template for students reports for the ISC degree programme at the School of engineering in Sion. Using the template\\n\\nIn the Typst web application, start with the isc-hei-report and voilà ! Using the CLI, you can initialize the project with the…","guid":"https://typst.app/universe/package/isc-hei-report","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-17T13:15:35.023Z","media":[{"url":"https://img.shields.io/github/stars/ISC-HEI/isc-hei-report","type":"photo","width":76,"height":20},{"url":"https://img.shields.io/github/v/release/ISC-HEI/isc-hei-report?include_prereleases","type":"photo","width":94,"height":20},{"url":"https://github.com/ISC-HEI/isc_logos/blob/4f8d335f7f4b99d3d83ee579ef334c201a15166a/ISC%20Logo%20inline%20v1.png?raw=true","type":"photo","width":6972,"height":1433}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"salsa-dip (0.1.0) | DIP chip labels for Typst","url":"https://typst.app/universe/package/salsa-dip","content":"Salsa Dip is a library for making DIP chip labels in Typst.
\\n#import \\"@preview/salsa-dip:0.1.0\\": dip-chip-label\\n\\n#set text(font: (\\"JetBrains Mono\\", \\"Fira Code\\", \\"DejaVu Sans Mono\\"), weight: \\"extrabold\\")\\n#set page(width: auto, height: auto, margin: .125cm)\\n\\n#let z80-labels = (\\"A11\\", ..., \\"A9\\", \\"A10\\")\\n\\n#dip-chip-label(40, 0.54in, z80-labels, \\"Z80\\", settings: (pin-number-margin: 1pt, pin-number-size: 2.5pt, chip-label-size: 5pt))\\n\\n
\\n#import \\"@preview/salsa-dip:0.1.0\\": dip-chip-label\\n\\n#set text(font: (\\"JetBrains Mono\\", \\"Fira Code\\", \\"DejaVu Sans Mono\\"), weight: \\"extrabold\\")\\n#set page(width: auto, height: auto, margin: .125cm)\\n\\n#let labels = (\\"1A\\", \\"1B\\", \\"1Y\\", \\"2A\\", \\"2B\\", \\"2Y\\", \\"GND\\", \\"3Y\\", \\"3A\\", \\"3B\\", \\"4Y\\", \\"4A\\", \\"4B\\", \\"VCC\\")\\n#dip-chip-label(14, 0.24in, labels, \\"74LS00\\")\\n
\\nThe dip-chip-label
function is called with four parameters, an integer number of pins for the chip, the width (usually 0.24in
or 0.54in
), the list of pin labels (if no labels are desired, an empty array can be passed), and the chip label.
There is an additional settings
parameter which can be used to fine tune the apperance of the chip labels. The settings
parameter is a dictionary optionally containing any of the setting keys:
chip-label-size
: Font size for the chip labelpin-number-margin
: Margin to give next to pin numberspin-number-size
: Font size for pin numberspin-label-size
: Font size for pin labelsinclude-numbers
: Boolean enabling pin numberspin-spacing
: Spacing of pinsvertical-margin
: Total margin to put into spacing above and below pin labels\\n \\n \\n \\n \\n
\\n \\n \\n
\\n \\n
imprecv
is a no-frills curriculum vitae (CV) template for Typst that uses a YAML file for data input in order to version control CV data easily.
This is based on the popular template on Reddit by u/SheetsGiggles and the recommendations of the r/EngineeringResumes wiki.
\\nSee example CV and @jskherman\'s CV:
\\nThis imprecv
is intended to be used by importing the template\'s package entrypoint from a \\"content\\" file (see template.typ
as an example).\\nIn this content file, call the functions which apply document styles, show CV components, and load CV data from a YAML file (see template.yml
as an example).\\nInside the content file you can modify several style variables and even override existing function implementations to your own needs and preferences.
The recommended usage with the Typst CLI is by running the command typst init @preview/imprecv:1.0.1
in your project directory.\\nThis will create a new Typst project with the imprecv
template and the necessary files to get started.\\nYou can then run typst compile template.typ
to compile your file to PDF.
Take a look at the example setup for ideas on how to get started. It includes a GitHub action workflow to compile the Typst files to PDF and upload it to Cloudflare R2.
\\nFrom the Dashboard, select \\"Start from template\\", search and choose the imprecv
template.\\nFrom there, decide on a name for your project and click \\"Create\\".\\nYou can now edit the template files and preview the result on the right.
You can also click the Create project in app
button in Typst Universe to create a new project with the imprecv
template.
I\'m only doing programming as a hobby so it might take me a while to respond to issues and pull requests.\\nIf you would like to contribute to this project, I would be happy to review your pull requests when I can.\\nThank you for your understanding.
\\n","description":"imprecv is a no-frills curriculum vitae (CV) template for Typst that uses a YAML file for data input in order to version control CV data easily. This is based on the popular template on Reddit by u/SheetsGiggles and the recommendations of the r…","guid":"https://typst.app/universe/package/imprecv","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-17T08:59:25.475Z","media":[{"url":"https://img.shields.io/badge/Star%20Repo-%E2%AD%90-1081c2.svg","type":"photo","width":86,"height":20},{"url":"https://img.shields.io/badge/license-Apache%202-brightgreen","type":"photo","width":108,"height":20},{"url":"https://img.shields.io/github/v/release/jskherman/imprecv","type":"photo","width":94,"height":20},{"url":"https://raw.githubusercontent.com/jskherman/imprecv/raw/main/assets/thumbnail.1.png","type":"photo"},{"url":"https://raw.githubusercontent.com/jskherman/imprecv/raw/main/assets/thumbnail.2.png","type":"photo"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"tuhi-labscript-vuw (0.1.0) | A labscript template for VUW experimental courses.","url":"https://typst.app/universe/package/tuhi-labscript-vuw","content":"A Typst template for VUW lab scripts. To get started:
\\ntypst init @preview/tuhi-labscript-vuw:0.1.0\\n
\\nAnd edit the main.typ
example.
PRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.
\\n","description":"A Typst template for VUW lab scripts. To get started: typst init @preview/tuhi-labscript-vuw:0.1.0\\n\\n\\nAnd edit the main.typ example.\\n\\nContributing\\n\\nPRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.","guid":"https://typst.app/universe/package/tuhi-labscript-vuw","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-17T08:52:06.521Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/tuhi-labscript-vuw/0.1.0/thumbnail.png","type":"photo","width":2067,"height":2923}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"modern-sysu-thesis (0.3.0) | 中山大学学位论文 Typst 模板,A Typst template for SYSU thesis","url":"https://typst.app/universe/package/modern-sysu-thesis","content":"本科生模板已经符合学位论文格式要求(#6),欢迎同学/校友们贡献代码/反馈问题(GitLab issue/邮件)!
\\n模板交流 QQ 群:797942860
\\n经过近一月紧张的迭代重构,本模板已经发布在typst-app.universe上,点击此处直接创建你的论文工程,并直接开始编写你的论文!
\\n\\ngit clone https://gitlab.com/sysu-gitlab/thesis-template/better-thesis
命令克隆本仓库。install_typst.ps1
文件,选择“用 Powershell 运行”,等待 Typst 安装完成。compile.bat
,即可生成 thesis.pdf
文件。git clone https://gitlab.com/sysu-gitlab/thesis-template/better-thesis
命令克隆本仓库。# 安装 Rust 环境并激活,之前安装过则不需要执行下面这两行\\ncurl --proto \'=https\' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\\nsource $HOME/.cargo/env\\n\\n# 安装 Typst CLI\\ncargo install typst-cli\\n\\n# 访问缓慢的话,执行以下命令设置清华镜像源,并从镜像站安装\\ncat << EOF > $HOME/.cargo/config\\n[source.crates-io]\\nreplace-with = \\"tuna\\"\\n\\n[source.tuna]\\nregistry = \\"https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git\\"\\nEOF\\ncargo install typst-cli\\n
\\n\\n详见 template\\\\thesis.typ
typst
命令自动管理安装= 标题
、*粗体*
、_斜体_
@引用
、 数学公式$E = m c^2$
)后者是在前者的基础上,同时参考 modern-nju-thesis ,改造后适配了 typst.app/universe。以及,放到 @sysu 组织下提高了曝光度。
\\nThis library is a wrapper around ICU4X\' datetime
formatting for Typst which provides internationalized formatting for dates, times, and timezones.
As the WASM bundle includes all localization data, it\'s quite large (about 8 MiB).
\\nSee nerixyz.github.io/icu-typ for a full API reference with more examples.
\\n#import \\"@preview/icu-datetime:0.1.2\\": fmt-date, fmt-time, fmt-datetime, experimental\\n// These functions may change at any time\\n#import experimental: fmt-timezone, fmt-zoned-datetime\\n\\n#let day = datetime(\\n year: 2024,\\n month: 5,\\n day: 31,\\n)\\n#let time = datetime(\\n hour: 18,\\n minute: 2,\\n second: 23,\\n)\\n#let dt = datetime(\\n year: 2024,\\n month: 5,\\n day: 31,\\n hour: 18,\\n minute: 2,\\n second: 23,\\n)\\n#let tz = (\\n offset: \\"-07\\",\\n iana: \\"America/Los_Angeles\\",\\n zone-variant: \\"st\\", // standard\\n)\\n\\n= Dates\\n#fmt-date(day, locale: \\"km\\", length: \\"full\\") \\\\\\n#fmt-date(day, locale: \\"af\\", length: \\"full\\") \\\\\\n#fmt-date(day, locale: \\"za\\", length: \\"full\\") \\\\\\n\\n= Time\\n#fmt-time(time, locale: \\"id\\", length: \\"medium\\") \\\\\\n#fmt-time(time, locale: \\"en\\", length: \\"medium\\") \\\\\\n#fmt-time(time, locale: \\"ga\\", length: \\"medium\\") \\\\\\n\\n= Date and Time\\n#fmt-datetime(dt, locale: \\"ru\\", date-length: \\"full\\") \\\\\\n#fmt-datetime(dt, locale: \\"en-US\\", date-length: \\"full\\") \\\\\\n#fmt-datetime(dt, locale: \\"zh-Hans-CN\\", date-length: \\"full\\") \\\\\\n#fmt-datetime(dt, locale: \\"ar\\", date-length: \\"full\\") \\\\\\n#fmt-datetime(dt, locale: \\"fi\\", date-length: \\"full\\")\\n\\n= Timezones (experimental)\\n#fmt-timezone(\\n ..tz,\\n local-date: datetime.today(),\\n format: \\"specific-non-location-long\\"\\n) \\\\\\n#fmt-timezone(\\n ..tz,\\n format: (\\n iso8601: (\\n format: \\"utc-extended\\",\\n minutes: \\"required\\",\\n seconds: \\"optional\\",\\n )\\n )\\n)\\n\\n= Zoned Datetimes (experimental)\\n#fmt-zoned-datetime(dt, tz) \\\\\\n#fmt-zoned-datetime(dt, tz, locale: \\"lv\\") \\\\\\n#fmt-zoned-datetime(dt, tz, locale: \\"en-CA-u-hc-h24-ca-buddhist\\")\\n
\\n\\nLocales must be Unicode Locale Identifiers.\\nUse locale-info(locale)
to get information on how a locale is parsed.\\nUnicode extensions are supported, so you can, for example, set the hour cycle with hc-h12
or set the calendar with ca-buddhist
(e.g. en-CA-u-hc-h24-ca-buddhist
).
Documentation can be found on nerixyz.github.io/icu-typ.
\\nDownload the latest release, unzip it to your local Typst packages, and use #import \\"@local/icu-datetime:0.1.2\\"
.
To build the library, you need to have Rust, just, and wasm-opt
installed.
just build\\n# to deploy the package locally, use `just deploy`\\n
\\nWhile developing, you can symlink the WASM file into the root of the repository (it\'s in the .gitignore
):
# Windows (PowerShell)\\nNew-Item icu-datetime.wasm -ItemType SymbolicLink -Value ./target/wasm32-unknown-unknown/debug/icu_typ.wasm\\n# Unix\\nln -s ./target/wasm32-unknown-unknown/debug/icu_typ.wasm icu-datetime.wasm\\n
\\nUse cargo b --target wasm32-unknown-unknown
to build in debug mode.
This repository provides a Typst template for creating sleek and minimalist professional business cards.
\\nThe function, minimalbc, allows you to customize the majority of the business card\'s elements.
\\nBy default, the layout is horizontal. However, it can be easily switched to a vertical layout by passing the value true to the flip argument in the minimalbc function.
\\nHere’s an example of how to use the minimalbc function:
\\n\\n#import \\"@preview/minimalbc:0.1.0\\": minimalbc\\n\\n#show: minimalbc.with(\\n // possible geo_size options: eu, us, jp , cn\\n geo_size: \\"eu\\",\\n flip:true,\\n company_name: \\"company name\\",\\n name: \\"first and last name\\",\\n role: \\"role\\",\\n telephone_number: \\"+000 00 000000\\",\\n email_address: \\"me@me.com\\",\\n website: \\"example.com\\",\\n company_logo: image(\\"company_logo.png\\"),\\n bg_color: \\"ffffff\\",\\n)\\n\\n\\n
\\nWhen compiled, this example produces a PDF file named \'your filename\'.pdf (see example.pdf).
\\nFeel free to download and use this as a starting point for your own business cards.
\\n","description":"This repository provides a Typst template for creating sleek and minimalist professional business cards. The function, minimalbc, allows you to customize the majority of the business card\'s elements.\\n\\nBy default, the layout is horizontal. However, it can be easily switched to a…","guid":"https://typst.app/universe/package/minimalbc","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-14T07:28:28.312Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"typearea (0.2.0) | A KOMA-Script inspired package to better configure your typearea and margins.","url":"https://typst.app/universe/package/typearea","content":"A KOMA-Script inspired package to better configure your typearea and margins.
\\n#import \\"@preview/typearea:0.2.0\\": typearea\\n\\n#show: typearea.with(\\n paper: \\"a4\\",\\n div: 9,\\n binding-correction: 11mm,\\n)\\n\\n= Hello World\\n
\\ntypearea
accepts the following options:
Whether the document is two-sided. Defaults to true
.
Binding correction. Defaults to 0pt
.
Additional margin on the inside of a page when two-sided is true. If two-sided is false it will be on the left or right side, depending on the value of binding
. A binding
value of auto
will currently default to left
.
Note: Before version 0.2.0 this was called bcor
.
How many equal parts to split the page into. Controls the margins. Defautls to 9
.
The top and bottom margin will always be one and two parts respectively. In two-sided mode the inside margin will be one part and the outside margin two parts, so the combined margins between the text on the left side and the text on the right side is the same as the margins from the outer edge of the text to the outer edge of the page.
\\nIn one-sided mode the left and right margin will take 1.5 parts each.
\\nThe height of the page header/footer.
\\nThe distance between the page header/footer and the text area.
\\nWhether the header/footer should be counted as part of the text area when calculating the margins. Defaults to false
.
All other arguments are passed on to page()
as is. You can see which arguments page()
accepts in the typst reference for the page function.
You should prefer this over calling or setting page()
directly as doing so could break some of typearea
\'s functionality.
A customizable resume/CV template focusing on clean and concise presentation, with a touch of color.
\\nTo compile this project you need the following:
\\nBuild the document once with
\\ntypst compile main.typ\\n
\\nBuild the document whenever you save changes by running
\\ntypst watch main.typ\\n
\\nThe following code provides a minimum working example:
\\n#import \\"@preview/modern-resume\\": *\\n\\n#show: modern-resume.with(\\n author: \\"John Doe\\", // Optional parameter\\n job-title: \\"Data Scientist\\", // Optional parameter\\n bio: lorem(5), // Optional parameter\\n avatar: image(\\"avatar.png\\"), // Optional parameter\\n contact-options: ( // All entries are optional\\n email: link(\\"mailto:john.doe@gmail.com\\")[john.doe\\\\@gmail.com],\\n mobile: \\"+43 1234 5678\\",\\n location: \\"Austria\\",\\n linkedin: link(\\"https://www.linkedin.com/in/jdoe\\")[linkedin/jdoe],\\n github: link(\\"https://github.com/jdoe\\")[github.com/jdoe],\\n website: link(\\"https://jdoe.dev\\")[jdoe.dev],\\n ),\\n)\\n\\n== Education\\n\\n#experience-edu(\\n title: \\"Master\'s degree\\",\\n subtitle: \\"University of Sciences\\",\\n task-description: [\\n - Short summary of the most important courses\\n - Explanation of master thesis topic\\n ],\\n date-from: \\"10/2021\\",\\n date-to: \\"07/2023\\",\\n)\\n\\n// More content goes here\\n\\n
\\nSee main.typ for a full example that showcases all available elements.
\\nExample outputs for different color palettes:
\\n| Default colors | Pink colors |\\n|:----------------:|:-------------:|\\n| |
|
Note: customization is currently only supported when cloning the template locally. Allowing customization via a \\"Typst universe\\"-installed template is a feature that is actively worked on.
\\nThe template allows you to make it yours by defining a custom color palette.\\nCustomize the color theme by changing the values of the color
dictionary in lib.typ. For example:
The default color palette:
\\n#let colors = (\\n primary: rgb(\\"#313C4E\\"),\\n secondary: rgb(\\"#222A33\\"),\\n accent-color: rgb(\\"#449399\\"),\\n text-primary: black,\\n text-secondary: rgb(\\"#7C7C7C\\"),\\n text-tertiary: white,\\n)\\n
\\nA pink color palette:
\\n#let colors = (\\n primary: rgb(\\"#e755e0\\"),\\n secondary: rgb(\\"#ad00c2\\"),\\n accent-color: rgb(\\"#00d032\\"),\\n text-primary: black,\\n text-secondary: rgb(\\"#7C7C7C\\"),\\n text-tertiary: white,\\n)\\n
\\nThis section introduces the visual elements that are part of this template.
\\nImport this element from the template module with pill
.
#pill(\\"German (native)\\")\\n#pill(\\"English (C1)\\")\\n
\\n#pill(\\"Teamwork\\", fill: true)\\n#pill(\\"Critical thinking\\", fill: true)\\n
\\nImport the elements from the template module with experience-edu
and experience-work
respectively.
#experience-edu(\\n title: \\"Master\'s degree\\",\\n subtitle: \\"University of Sciences\\",\\n task-description: [\\n - Short summary of the most important courses\\n - Explanation of master thesis topic\\n ],\\n date-from: \\"10/2021\\",\\n date-to: \\"07/2023\\",\\n)\\n
\\n#experience-work(\\n title: \\"Full Stack Software Engineer\\",\\n subtitle: [#link(\\"https://www.google.com\\")[Some IT Company]],\\n facility-description: \\"Company operating in sector XY\\",\\n task-description: [\\n - Short summary of your responsibilities\\n ],\\n date-from: \\"09/2018\\",\\n date-to: \\"07/2021\\",\\n)\\n
\\nImport this element from the template module with project
.
#project(\\n title: \\"Project 2\\",\\n subtitle: \\"Data Visualization, Data Engineering\\",\\n description: [\\n - #lorem(20)\\n ],\\n date-from: \\"08/2022\\",\\n date-to: \\"09/2022\\",\\n)\\n
\\nI\'m grateful for any improvements and suggestions.
\\nThis project would not be what it is without:
\\nYet another John Doe CV.
\\n\\nA Typst CV template that aims for :
\\nCreate a new project based on the template minimal-cv.
\\nThe default font is \\"Inria Sans\\". Make sure it is installed on your system, or change it in # Theme.
\\nCopy the template to your Typst project.
\\nImport the library :
\\n#import \\"@preview/minimal-cv:0.1.0\\": *\\n
\\nShow the root cv
function :
#show: cv.with(\\n theme: (),\\n title: \\"YOUR NAME\\",\\n subtitle: \\"YOUR POSITION\\",\\n aside: [\\n ASIDE CONTENT\\n ]\\n\\nMAIN CONTENT\\n
\\nSeveral content functions are available.
\\nSection
\\n#section(\\n theme: (),\\n \\"TITLE_CONTENT\\",\\n \\"BODY_CONTENT\\",\\n)\\n
\\nEntry
\\n#entry(\\n theme: (),\\n right: \\"FLOATING_CONTENT\\",\\n\\n \\"GUTTER_CONTENT\\",\\n \\"TITLE_CONTENT\\",\\n \\"BODY_CONTENT\\",\\n)\\n
\\nProgress bar
\\n#progress-bar(50%)\\n
\\nCustomize the theme by specifying the theme
parameter and overriding 1 or more keys.
cv
| Key | Type | Default\\n| --- | ---- | -------\\n| margin
| relative | 22pt
\\n| font
| relative | \\"Inria Sans\\"
\\n| font-size
| relative | 11pt
\\n| accent-color
| color | blue
\\n| body-color
| color | rgb(\\"222\\")
\\n| header-accent-color
| color | inherit\\n| header-body-color
| color | inherit\\n| main-accent-color
| color | inherit\\n| main-body-color
| color | inherit\\n| main-width
| relative | 5fr
\\n| main-gutter-width
| relative | 64pt
\\n| aside-accent-color
| color | inherit\\n| aside-body-color
| color | inherit\\n| aside-width
| relative | 3fr
\\n| aside-gutter-width
| relative | 48pt
section
| Key | Type | Default\\n| --- | ---- | -------\\n| gutter-size
| color | inherit\\n| accent-color
| color | inherit\\n| body-color
| color | inherit
entry
| Key | Type | Default\\n| --- | ---- | -------\\n| gutter-size
| color | inherit\\n| accent-color
| color | inherit\\n| body-color
| color | inherit
Following the official tutorial, I create a single-column paper template for general use. You can use it for papers published on SSRN etc.
\\nTypst integrated the template with their official package manager. You can use it as the other third-party packages.
\\nYou only need to enter the following command in the terminal to initialize the template.
\\ntypst init @preview/ssrn-scribe\\n
\\nIf will generate a subfolder ssrn-scribe
including the main.typ
file in the current directory with the latest version of the template.
.biblatex
and store the file in the same directory of the template.main.typ
file in the subfolder /template
and compile it.\\nNote: You should have paper_template.typ
and main.typ
in the same directory.In the template, you can modify the following parameters:
\\nmaketitle
is a boolean (compulsory). If maketitle=true
, the template will generate a new page for the title. Otherwise, the title will be shown on the first page.
maketitle=true
:| Parameter | Default | Optional | Description |\\n| ------------------- | ---------- | -------- | ---------------------------------------------------------------------------------------------------------- |\\n| font
| \\"PT Serif\\" | Yes | The font of the paper. You can choose \\"Times New Roman\\" or \\"Palatino\\" |\\n| fontsize
| 11pt | Yes | The font size of the paper. You can choose 10pt or 12pt |\\n| title
| \\"Title\\" | No | The title of the paper |\\n| subtitle
| none | Yes | The subtitle of the paper, use \\"\\" or [] |\\n| authors
| none | No | The authors of the paper |\\n| date
| none | Yes | The date of the paper |\\n| abstract
| none | Yes | The abstract of the paper |\\n| keywords
| none | Yes | The keywords of the paper |\\n| JEL
| none | Yes | The JEL codes of the paper |\\n| acknowledgments
| none | Yes | The acknowledgment of the paper |\\n| bibliography
| none | Yes | The bibliography of the paper bibliography: bibliography(\\"bib.bib\\", title: \\"References\\", style: \\"apa\\")
|
maketitle=false
:| Parameter | Default | Optional | Description |\\n| ---------------- | ---------- | -------- | ---------------------------------------------------------------------------------------------------------- |\\n| font
| \\"PT Serif\\" | Yes | The font of the paper. You can choose \\"Times New Roman\\" or \\"Palatino\\" |\\n| fontsize
| 11pt | Yes | The font size of the paper. You can choose 10pt or 12pt |\\n| title
| \\"Title\\" | No | The title of the paper |\\n| subtitle
| none | Yes | The subtitle of the paper, use \\"\\" or [] |\\n| authors
| none | No | The authors of the paper |\\n| date
| none | Yes | The date of the paper |\\n| bibliography
| none | Yes | The bibliography of the paper bibliography: bibliography(\\"bib.bib\\", title: \\"References\\", style: \\"apa\\")
|
Note: You need to keep the comma at the end of the first bracket of the author\'s list, even if you have only one author.
\\n (\\n name: \\"\\",\\n affiliation: \\"\\", // optional\\n email: \\"\\", // optional\\n note: \\"\\", // optional\\n ),\\n
\\n#import \\"@preview/ssrn-scribe:0.6.0\\": *\\n\\n#show: paper.with(\\n font: \\"PT Serif\\", // \\"Times New Roman\\"\\n fontsize: 12pt, // 12pt\\n maketitle: true, // whether to add new page for title\\n title: [#lorem(5)], // title \\n subtitle: \\"A work in progress\\", // subtitle\\n authors: (\\n (\\n name: \\"Theresa Tungsten\\",\\n affiliation: \\"Artos Institute\\",\\n email: \\"tung@artos.edu\\",\\n note: \\"123\\",\\n ),\\n ),\\n date: \\"July 2023\\",\\n abstract: lorem(80), // replace lorem(80) with [ Your abstract here. ]\\n keywords: [\\n Imputation,\\n Multiple Imputation,\\n Bayesian,],\\n JEL: [G11, G12],\\n acknowledgments: \\"This paper is a work in progress. Please do not cite without permission.\\", \\n // bibliography: bibliography(\\"bib.bib\\", title: \\"References\\", style: \\"apa\\"),\\n)\\n= Introduction\\n#lorem(50)\\n\\n
\\nHere is a screenshot of the template:\\n
maketitle=true
maketitle=false
An attempt to fix the indentation of the first paragraph in typst.
\\nIt works.
\\n#set par(first-line-indent: 2em)\\n#import \\"@preview/indenta:0.0.3\\": fix-indent\\n#show: fix-indent()\\n\\n
\\nWhen you use fix-indent()
with other show rules, make sure to call fix-indent()
after other show rules. For example:
#show heading.where(level: 1): set text(size: 20pt)\\n#show: fix-indent()\\n
\\nIf you want to process the content inside your custom block, you can call fix-indent
inside your block. For example:
#block[#set text(fill: red)\\n#show: fix-indent()\\n\\nHello\\n\\n#table()[table]\\n\\nWorld\\n]\\n
\\nThis package is in a very early stage and may not work as expected in some cases. Currently, there is no easy way to check if an element is inlined or not. If you got an unexpected result, you can try fix-indent(unsafe: true)
to disable the check.
Minor fixes can be made at any time, but the package in typst universe may not be updated immediately. You can check the latest version on GitHub then copy and paste the code into your typst file.
\\nIf it still doesn\'t work as expected, you can try another solution (aka fake-par solution):
\\n#let fakepar=context{box();v(-measure(block()+block()).height)}\\n#show heading: it=>it+fakepar\\n#show figure: it=>it+fakepar\\n#show math.equation.where(block: true): it=>it+fakepar\\n// ... other elements\\n
\\n","description":"An attempt to fix the indentation of the first paragraph in typst. It works.\\n\\nUsage\\n#set par(first-line-indent: 2em)\\n#import \\"@preview/indenta:0.0.3\\": fix-indent\\n#show: fix-indent()\\n\\n\\nDemo\\n\\nNote\\n\\nWhen you use fix-indent() with other show rules, make sure to call fix-indent() after…","guid":"https://typst.app/universe/package/indenta","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-10T09:09:33.932Z","media":[{"url":"https://github.com/flaribbit/indenta/assets/24885181/874df696-3277-4103-9166-a24639b0c7c6","type":"photo","width":1173,"height":727}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"vonsim (0.1.0) | Syntax highlighting support for VonSim.","url":"https://typst.app/universe/package/vonsim","content":"This package adds the ability to syntax highlighting VonSim source code in Typst.
\\nTo add global support for VonSim, just add these lines and use a raw block with vonsim
as its language.
#import \\"@preview/vonsim:0.1.0\\": init-vonsim\\n\\n// Adds global support for VonSim\\n#show: init-vonsim\\n\\n// Highlight VonSim code\\n```vonsim\\n; Welcome to VonSim!\\n; This is an example program that calculates the first\\n; n numbers of the Fibonacci sequence, and stores them\\n; starting at memory position 1000h.\\n\\n n equ 10 ; Calculate the first 10 numbers\\n\\n org 1000h\\nstart db 1\\n\\n org 2000h\\n mov bx, offset start + 1\\n mov al, 0\\n mov ah, start\\n\\nloop: cmp bx, offset start + n\\n jns finish\\n mov cl, ah\\n add cl, al\\n mov al, ah\\n mov ah, cl\\n mov [bx], cl\\n inc bx\\n jmp loop\\nfinish: hlt\\n end\\n```\\n
\\nAlternatively, use init-vonsim-full
to also use the VonSim theme.
Typst Template for short documents and letters for the french engineering school INSA.
\\nBy default, the template initializes with the insa-letter
show rule, with parameters that you must fill in by yourself.
Here is an example of filled template:
\\n#import \\"@preview/silky-letter-insa:0.2.1\\": *\\n#show: doc => insa-letter(\\n author: \\"Youenn LE JEUNE, Kelian NINET\\",\\n insa: \\"rennes\\"\\n doc)\\n\\n#v(15pt)\\n#align(center, text(size: 22pt, weight: \\"bold\\", smallcaps(\\"Probabilités - Annale 2022 (V1)\\")))\\n#v(5pt)\\n\\n#set heading(numbering: \\"1.\\")\\n#show heading.where(level: 2): it => [\\n #counter(heading).display()\\n #text(weight: \\"medium\\", style: \\"italic\\", size: 13pt, it.body)\\n\\n]\\n\\n= Intervalle de confiance\\n== Calculer sur l’échantillon une estimation de la moyenne.\\n$ overline(x_n) = 1/n sum_(i=1)^n x_i = 1885 $\\n\\n== Calculer sur l’échantillon une estimation de la variance.\\n$\\n\\"Variance biaisée :\\" s^2 &= 1/n sum_(i=1)^n (x_i - overline(x_n))^2 = 218^2\\\\\\n\\"Variance corrigée :\\" s\'^2 &= n/(n-1) s^2 = 231^2\\n$\\n\\nLe bon estimateur est le second.\\n\\n== Écrire le code R permettant d’évaluer les deux bornes de l’intervalle de confiance du temps d’exécution avec une confiance de 92%.\\nNous sommes dans le cas d\'une recherche de moyenne avec variance inconnue, l\'intervalle sera donc\\n$ [overline(X) + t_(n-1)(alpha/2) S\'/sqrt(n), quad overline(X) + t_(n-1)(1 - alpha/2) S\'/sqrt(n)] $\\nEn R, avec l\'échantillon nommé `data`, ça donne\\n```R\\ndata = c(1653, 2059, 2281, 1813, 2180, 1721, 1857, 1677, 1728)\\nmoyenne = mean(data)\\ns_prime = sqrt(var(data)) # car la variance de R est déjà corrigée\\nn = 9\\nalpha = 0.08\\n\\nIC_min = moyenne + qt(alpha / 2, df = n - 1) * s_prime / sqrt(n)\\nIC_max = moyenne + qt(1 - alpha / 2, df = n - 1) * s_prime / sqrt(n)\\n```\\n\\nIci on a $[1730, 2040]$.\\n
\\nThe graphic charter recommends the fonts League Spartan for headings and Source Serif for regular text. To have the best look, you should install those fonts.
\\nTo behave correctly on computers without those specific fonts installed, this template will automatically fallback to other similar fonts:
\\nIf you want to install those fonts on your computer, Typst might not recognize them if you install their Variable versions. You should install the static versions (League Spartan Bold and most versions of Source Serif).
\\nKeep an eye on the issue in Typst bug tracker to see when variable fonts will be used!
\\nThis template is being developed by Youenn LE JEUNE from the INSA de Rennes in this repository.
\\nFor now it includes assets from the INSA de Rennes graphic charter, but users from other INSAs can open an issue on the repository with the correct assets for their INSA.
\\nIf you have any other feature request, open an issue on the repository as well.
\\nThe typst template is licensed under the MIT license. This does not apply to the image assets. Those image files are property of Groupe INSA and INSA Rennes.
\\ninsa
optionUse railroads in your documents.
\\nYou use the function by calling render(diagram-text, css)
which renders the diagram. There, diagram-text
contains is the diagram itself and css is the one used for the style, css
is default-css()
if you don\'t pass it. Both fields can be strings, bytes or a raw raw block.
A simple CV template for typst.app.
\\nCreate a project on typst.app, copy paste everything in https://github.com/skyzh/chicv/blob/master/template/cv.typ. All done!
\\nTo change the text size, you can uncomment the lines in cv.typ
and set to your choice. (Recommended text size for CV is from 10pt to 12pt)
You can also change the page margin in cv.typ
to fit in more contents in a single page. The margin default is set to (x: 0.9cm, y: 1.3cm)
.
Don\'t forget to include #chiline()
every time you open a new section, this line acts as a perfect split.
For basic typst syntax, check this template as a reference, it\'s super easy to understand and use!
\\nFor advanced topics, please refer to official reference by typst.
\\n\\n
\\n\\npiece of cake
\\n
\\npeace of mind
\\npeace of posters
peace-of-posters (PoP) is a Typst package to help creating scientific posters.\\nIt is flexible and can be used for different sizes and layouts.\\nTo see what is possible have a look at some of my own real-world examples in the showcase section of the documentation.
\\nThe external documentation is coming along slowly.\\nMost notably, there are examples and showcases missing but I hope to be adding them over the coming months.
\\nDownload the MIT License
\\n","description":"piece of cake peace of mind\\n peace of posters\\n\\npeace-of-posters (PoP) is a Typst package to help creating scientific posters. It is flexible and can be used for different sizes and layouts. To see what is possible have a look at some of my own real-world examples in the showca…","guid":"https://typst.app/universe/package/peace-of-posters","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-03T15:10:07.930Z","media":[{"url":"https://img.shields.io/github/actions/workflow/status/jonaspleyer/peace-of-posters/test.yml?style=flat-square&label=Test","type":"photo","width":84,"height":20},{"url":"https://img.shields.io/github/actions/workflow/status/jonaspleyer/peace-of-posters/docs.yml?style=flat-square&label=Docs","type":"photo","width":88,"height":20}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"nassi (0.1.2) | Draw Nassi-Shneiderman diagrams (Struktogramme) with Typst.","url":"https://typst.app/universe/package/nassi","content":"nassi is a package for Typst to draw Nassi-Shneiderman diagrams (Struktogramme).
\\nImport nassi in your document:
\\n#import \\"@preview/nassi:0.1.2\\"\\n
\\nThere are several options to draw diagrams. One is to parse all code-blocks with the language \\"nassi\\". Simply add a show-rule like this:
\\n#import \\"@preview/nassi:0.1.2\\"\\n#show: nassi.shneiderman()\\n\\n```nassi\\nfunction ggt(a, b)\\n while a > 0 and b > 0\\n if a > b\\n a <- a - b\\n else\\n b <- b - a\\n endif\\n endwhile\\n if b == 0\\n return a\\n else\\n return b\\n endif\\nendfunction\\n```\\n
\\nIn this case, the diagram is created from a simple pseudocode. To have more control over the output, you can add blocks manually using the element functions provided in nassi.elements
:
#import \\"@preview/nassi:0.1.2\\"\\n\\n#nassi.diagram({\\nimport nassi.elements: *\\n\\nfunction(\\"ggt(a, b)\\", {\\nloop(\\"a > b and b > 0\\", {\\nbranch(\\"a > b\\", {\\nassign(\\"a\\", \\"a - b\\")\\n}, {\\nassign(\\"b\\", \\"b - a\\",\\nfill: gradient.linear(..color.map.rainbow),\\nstroke:red + 2pt\\n)\\n})\\n})\\nbranch(\\"b == 0\\", { process(\\"return a\\") }, { process(\\"return b\\") })\\n})\\n})\\n
\\nSince nassi uses cetz for drawing, you can add diagrams directly to a canvas. Each block gets a name within the diagram group to reference it in the drawing:
\\n#import \\"@preview/cetz:0.2.2\\"\\n#import \\"@preview/nassi:0.1.2\\"\\n\\n#cetz.canvas({\\n import nassi.draw: diagram\\n import nassi.elements: *\\n import cetz.draw: *\\n\\n diagram((4,4), {\\n function(\\"ggt(a, b)\\", {\\n loop(\\"a > b and b > 0\\", {\\n branch(\\"a > b\\", {\\n assign(\\"a\\", \\"a - b\\")\\n }, {\\n assign(\\"b\\", \\"b - a\\")\\n })\\n })\\n branch(\\"b == 0\\", { process(\\"return a\\") }, { process(\\"return b\\") })\\n })\\n })\\n\\n for i in range(8) {\\n content(\\n \\"nassi.e\\" + str(i+1) + \\".north-west\\",\\n stroke:red,\\n fill:red.transparentize(50%),\\n frame:\\"circle\\",\\n padding:.05,\\n anchor:\\"north-west\\",\\n text(white, weight:\\"bold\\", \\"e\\"+str(i)),\\n )\\n }\\n})\\n
\\nThis can be useful to annotate a diagram:
\\nSee assets/
for usage examples.
switch
statements (thanks to @Geronymos).Initial release of nassi.
\\n","description":"nassi is a package for Typst to draw Nassi-Shneiderman diagrams (Struktogramme). Usage\\n\\nImport nassi in your document:\\n\\n#import \\"@preview/nassi:0.1.2\\"\\n\\n\\nThere are several options to draw diagrams. One is to parse all code-blocks with the language \\"nassi\\". Simply add a show-rule…","guid":"https://typst.app/universe/package/nassi","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-06-03T15:03:12.000Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/nassi/0.1.2/assets/example-1.png","type":"photo","width":1280,"height":493,"blurhash":"LbQS*e%2t6xuyDa}WCkB.Ta}WBkC"},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/nassi/0.1.2/assets/example-3.png","type":"photo","width":1280,"height":493,"blurhash":"LhQ0HqxAw~nmtmj]j?j]?wXTOTo{"},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/nassi/0.1.2/assets/example-cetz-2.png","type":"photo","width":1280,"height":529,"blurhash":"LWQvRN$,xv.8x^i_n$oL*0adV?i_"},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/nassi/0.1.2/assets/example-cetz.png","type":"photo","width":1837,"height":687,"blurhash":"LeRMF~xtogxu.8ofayof.Aa~ayj["}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"datify (0.1.2) | Datify is a simple date package that allows users to format dates in new ways and addresses the issue of lacking date formats in diff...","url":"https://typst.app/universe/package/datify","content":"Datify is a simple date package that allows users to format dates in new ways and addresses the issue of lacking date formats in different languages.
\\nTo include this package in your Typst project, add the following to your project file:
\\n#import \\"@preview/datify:0.1.2\\": day-name, month-name, custom-date-format\\n
\\nday-name
Returns the name of the weekday.
\\n#import \\"@preview/datify:0.1.2\\": day-name\\n\\n#day-name(2)\\n#day-name(1,\\"fr\\",true)\\n
\\nOutput:
\\ntuesday\\nLundi\\n
\\nday-name(weekday: int or str, lang: str, upper: boolean) --\x3e str\\n
\\n| Parameter | Description | Default |\\n|-----------|--------------------------------------------------------|---------|\\n| weekday* | The weekday as an integer (1-7) or a string (\\"1\\"-\\"7\\"). | none |\\n| lang | An ISO 639-1 code representing the language. | en |\\n| upper | A boolean that sets the first letter to be uppercase. | false |
\\n* required
\\nmonth-name
Returns the name of the month.
\\n#import \\"@preview/datify:0.1.2\\": month-name\\n\\n#month-name(2)\\n#month-name(1, \\"fr\\", true)\\n
\\nOutput:
\\nfebruary\\nJanvier\\n
\\nmonth-name(month: int or str, lang: str = \'en\', upper: bool = false) -> str\\n
\\n| Parameter | Description | Default |\\n|-----------|--------------------------------------------------------|---------|\\n| month* | The month as an integer (1-12) or a string (\\"1\\"-\\"12\\"). | none |\\n| lang | An ISO 639-1 code representing the language. | en |\\n| upper | A boolean that sets the first letter to be uppercase. | false |
\\n* required
\\ncustom-date-format
Formats a given date according to a specified format and language.
\\n#import \\"@preview/datify:0.1.2\\": custom-date-format\\n\\n#let my-date = datetime(year: 2024, month: 8, day: 4)\\n#custom-date-format(my-date, \\"MMMM DDth, YYYY\\")\\n
\\nOutput:
\\nAugust 04th, 2024\\n
\\ncustom-date-format(date: datetime, format: str, lang: str = \'en\') -> str\\n
\\n| Parameter | Description | Default |\\n|-----------|------------------------------------------------|---------|\\n| date* | A datetime object representing the date. | none |\\n| format* | A string representing the desired date format. | none |\\n| lang | An ISO 639-1 code representing the language. | en |\\n* required
\\nBelow is a table of all possible format types that can be used in the format string:
\\n| Format | Description | Example |\\n|--------|----------------------------------------|---------------|\\n| DD
| Day of the month, 2 digits | 05 |\\n| day
| Full name of the day | tuesday |\\n| Day
| Capitalized full name of the day | Tuesday |\\n| DAY
| Uppercase full name of the day | TUESDAY |\\n| MMMM
| Capitalized full name of the month | May |\\n| MMM
| Short name of the month (first 3 chars)| May |\\n| MM
| Month number, 2 digits | 05 |\\n| month
| Full name of the month | may |\\n| Month
| Capitalized full name of the month | May |\\n| MONTH
| Uppercase full name of the month | MAY |\\n| YYYY
| 4-digit year | 2023 |\\n| YY
| Last 2 digits of the year | 23 |
Here are some examples demonstrating the usage of the functions provided by the Datify package:
\\n#let my-date = datetime(year: 2024, month: 12, day: 25)\\n\\n#custom-date-format(my-date, \\"DD-MM-YYYY\\") // Output: 25-12-2024\\n#custom-date-format(my-date, \\"Day, DD Month YYYY\\", \\"fr\\") // Output: Mercredi, 25 Décembre 2024\\n\\n#day-name(4) // Output: thursday\\n\\n#month-name(12) // Output: december\\n
\\n| ISO 639-1 code | Status |\\n|----------------|--------------|\\n| aa | ❌ |\\n| ab | ❌ |\\n| ae | ❌ |\\n| af | ❌ |\\n| ak | ❌ |\\n| am | ❌ |\\n| an | ❌ |\\n| ar | ❌ |\\n| as | ❌ |\\n| av | ❌ |\\n| ay | ❌ |\\n| az | ❌ |\\n| ba | ❌ |\\n| be | ❌ |\\n| bg | ❌ |\\n| bh | ❌ |\\n| bi | ❌ |\\n| bm | ❌ |\\n| bn | ❌ |\\n| bo | ❌ |\\n| br | ❌ |\\n| bs | ❌ |\\n| ca | ❌ |\\n| ce | ❌ |\\n| ch | ❌ |\\n| co | ❌ |\\n| cr | ❌ |\\n| cs | ❌ |\\n| cu | ❌ |\\n| cv | ❌ |\\n| cy | ❌ |\\n| da | ❌ |\\n| de | ✅ |\\n| dv | ❌ |\\n| dz | ❌ |\\n| ee | ❌ |\\n| el | ❌ |\\n| en | ✅ |\\n| eo | ❌ |\\n| es | ❌ |\\n| et | ❌ |\\n| eu | ❌ |\\n| fa | ❌ |\\n| ff | ❌ |\\n| fi | ❌ |\\n| fj | ❌ |\\n| fo | ❌ |\\n| fr | ✅ |\\n| fy | ❌ |\\n| ga | ❌ |\\n| gd | ❌ |\\n| gl | ❌ |\\n| gn | ❌ |\\n| gu | ❌ |\\n| gv | ❌ |\\n| ha | ❌ |\\n| he | ❌ |\\n| hi | ❌ |\\n| ho | ❌ |\\n| hr | ❌ |\\n| ht | ❌ |\\n| hu | ❌ |\\n| hy | ❌ |\\n| hz | ❌ |\\n| ia | ❌ |\\n| id | ❌ |\\n| ie | ❌ |\\n| ig | ❌ |\\n| ii | ❌ |\\n| ik | ❌ |\\n| io | ❌ |\\n| is | ❌ |\\n| it | ❌ |\\n| iu | ❌ |\\n| ja | ❌ |\\n| jv | ❌ |\\n| ka | ❌ |\\n| kg | ❌ |\\n| ki | ❌ |\\n| kj | ❌ |\\n| kk | ❌ |\\n| kl | ❌ |\\n| km | ❌ |\\n| kn | ❌ |\\n| ko | ❌ |\\n| kr | ❌ |\\n| ks | ❌ |\\n| ku | ❌ |\\n| kv | ❌ |\\n| kw | ❌ |\\n| ky | ❌ |\\n| la | ❌ |\\n| lb | ❌ |\\n| lg | ❌ |\\n| li | ❌ |\\n| ln | ❌ |\\n| lo | ❌ |\\n| lt | ❌ |\\n| lu | ❌ |\\n| lv | ❌ |\\n| mg | ❌ |\\n| mh | ❌ |\\n| mi | ❌ |\\n| mk | ❌ |\\n| ml | ❌ |\\n| mn | ❌ |\\n| mr | ❌ |\\n| ms | ❌ |\\n| mt | ❌ |\\n| my | ❌ |\\n| na | ❌ |\\n| nb | ❌ |\\n| nd | ❌ |\\n| ne | ❌ |\\n| ng | ❌ |\\n| nl | ❌ |\\n| nn | ❌ |\\n| no | ❌ |\\n| nr | ❌ |\\n| nv | ❌ |\\n| ny | ❌ |\\n| oc | ❌ |\\n| oj | ❌ |\\n| om | ❌ |\\n| or | ❌ |\\n| os | ❌ |\\n| pa | ❌ |\\n| pi | ❌ |\\n| pl | ❌ |\\n| ps | ❌ |\\n| pt | ❌ |\\n| qu | ❌ |\\n| rm | ❌ |\\n| rn | ❌ |\\n| ro | ❌ |\\n| ru | ❌ |\\n| rw | ❌ |\\n| sa | ❌ |\\n| sc | ❌ |\\n| sd | ❌ |\\n| se | ❌ |\\n| sg | ❌ |\\n| si | ❌ |\\n| sk | ❌ |\\n| sl | ❌ |\\n| sm | ❌ |\\n| sn | ❌ |\\n| so | ❌ |\\n| sq | ❌ |\\n| sr | ❌ |\\n| ss | ❌ |\\n| st | ❌ |\\n| su | ❌ |\\n| sv | ❌ |\\n| sw | ❌ |\\n| ta | ❌ |\\n| te | ❌ |\\n| tg | ❌ |\\n| th | ❌ |\\n| ti | ❌ |\\n| tk | ❌ |\\n| tl | ❌ |\\n| tn | ❌ |\\n| to | ❌ |\\n| tr | ❌ |\\n| ts | ❌ |\\n| tt | ❌ |\\n| tw | ❌ |\\n| ty | ❌ |\\n| ug | ❌ |\\n| uk | ❌ |\\n| ur | ❌ |\\n| uz | ❌ |\\n| ve | ❌ |\\n| vi | ❌ |\\n| vo | ❌ |\\n| wa | ❌ |\\n| wo | ❌ |\\n| xh | ❌ |\\n| yi | ❌ |\\n| yo | ❌ |\\n| za | ❌ |\\n| zh | ❌ |\\n| zu | ❌ |
\\nContributions are welcome! Please feel free to submit a pull request or open an issue if you encounter any problems.
\\nThis project is licensed under the MIT License.
\\nGitHub Repository including Examples and Changelog
\\nThis is a small package providing over- and underset functions for math mode in typst.
\\nTo use this package simply #import \\"@preview/ouset:0.2.0\\"
. To import all functions use : *
and for specific ones, use either the module or as described in the typst docs.
The main function provided in this package is ouset
for math environments. This function can take arbitrary many arguments, but with the following rules:
&
, a \'alignpoint\' is inserted immediately before the symbol&
, a \'alignpoint\' is inserted immediately after the symbolThere is a named argument insert-and
, which if false, does not insert an \'alignpoint\' in the above cases, but only clips at these points.
This package provides furthermore 3 other functions:
\\noverset(s, t, c: 0, insert-and: true)
: output the symbol s with t on top of itunderset(s, b, c: 0 insert-and: true)
: output the symbol s with b on below of itoverunderset(s, t, b, c: 0, insert-and: true)
: output the symbol s with t on top of it and b below itAll functions put enough spacing around the operator, such that other content does not interfere with it. However, this spacing can be disabled, by setting c
to 1, 2 or 3. This is a flag system with
c=0
: normal spacing on the left and rightc=1
: left spacing is according to the operator / symbol s and right spacing is normalc=2
: left spacing is normal and right spacing according to the operator / symbol sc=3
: both spacings are according to the operator / symbol sHence: clip param c ∈ {0,1,2,3} ≜ {no clip, left clip, right clip, both clip}
Try something like:
\\n$ouset(--\x3e,, n->oo)$
$ouset(-,1,2)$
#import \\"@preview/ouset:0.2.0\\": ouset\\n\\n$ M &= sum_(k=0)^oo q^k = 1 + q + q^2 + q^3 + q^4 + dots\\\\\\n &= 1 + q (1 + q + q^2 + q^3 + dots)\\\\\\n ouset(&, =, \\"Def.\\", \\"of\\" M) 1 + q dot M $\\n
\\n\\n\\n[!TIP]\\nGlossarium is based in great part of the work of Sébastien d\'Herbais de Thun from his master thesis available at: https://github.com/Dherse/masterproef. His glossary is available under the MIT license here.
\\n
Glossarium is a simple, easily customizable typst glossary inspired by LaTeX glossaries package . You can see various examples showcasing the different features in the examples
folder.
#import \\"@preview/glossarium:0.5.1\\": make-glossary, register-glossary, print-glossary, gls, glspl\\n#show: make-glossary\\n#let entry-list = (\\n (\\n key: \\"kuleuven\\",\\n short: \\"KU Leuven\\",\\n long: \\"Katholieke Universiteit Leuven\\",\\n description: \\"A university in Belgium.\\",\\n ),\\n // Add more terms\\n)\\n#register-glossary(entry-list)\\n// Your document body\\n#print-glossary(\\n entry-list\\n)\\n
\\nThis manual assume you have a good enough understanding of typst markup and scripting.
\\nFor Typst 0.6.0 or later import the package from the typst preview repository:
\\n#import \\"@preview/glossarium:0.5.1\\": make-glossary, register-glossary, print-glossary, gls, glspl\\n
\\nFor Typst before 0.6.0 or to use glossarium as a local module, download the package files into your project folder and import glossarium.typ
:
#import \\"glossarium.typ\\": make-glossary, register-glossary, print-glossary, gls, glspl\\n
\\nAfter importing the package and before making any calls to gls
, print-glossary
or glspl
, please MAKE SURE you add this line
#show: make-glossary\\n
\\n\\n\\nWHY DO WE NEED THAT ? : In order to be able to create references to the terms in your glossary using typst ref syntax
\\n@key
glossarium needs to setup some show rules before any references exist. This is due to the way typst works, there is no workaround.Therefore I recommend that you always put the
\\n#show: ...
statement on the line just below the#import
statement.
First we have to define the terms.\\nA term is a dictionary as follows:
\\n| Key | Type | Required/Optional | Description |\\n| ------------- | ----------------- | ----------------- | -------------------------------------------------------------------------------------------- |\\n| key
| string | required | Case-sensitive, unique identifier used to reference the term. |\\n| short
| string | semi-optional | The short form of the term replacing the term citation. |\\n| long
| string or content | semi-optional | The long form of the term, displayed in the glossary and on the first citation of the term. |\\n| description
| string or content | optional | The description of the term. |\\n| plural
| string or content | optional | The pluralized short form of the term. |\\n| longplural
| string or content | optional | The pluralized long form of the term. |\\n| group
| string | optional | Case-sensitive group the term belongs to. The terms are displayed by groups in the glossary. |
#let entry-list = (\\n // minimal term\\n (\\n key: \\"kuleuven\\",\\n short: \\"KU Leuven\\"\\n ),\\n // a term with a long form and a group\\n (\\n key: \\"unamur\\",\\n short: \\"UNamur\\",\\n long: \\"Namur University\\",\\n group: \\"Universities\\"\\n ),\\n // a term with a markup description\\n (\\n key: \\"oidc\\",\\n short: \\"OIDC\\",\\n long: \\"OpenID Connect\\",\\n description: [\\n OpenID is an open standard and decentralized authentication protocol promoted by the non-profit\\n #link(\\"https://en.wikipedia.org/wiki/OpenID#OpenID_Foundation\\")[OpenID Foundation].\\n ],\\n group: \\"Acronyms\\",\\n ),\\n // a term with a short plural\\n (\\n key: \\"potato\\",\\n short: \\"potato\\",\\n // \\"plural\\" will be used when \\"short\\" should be pluralized\\n plural: \\"potatoes\\",\\n description: [#lorem(10)],\\n ),\\n // a term with a long plural\\n (\\n key: \\"dm\\",\\n short: \\"DM\\",\\n long: \\"diagonal matrix\\",\\n // \\"longplural\\" will be used when \\"long\\" should be pluralized\\n longplural: \\"diagonal matrices\\",\\n description: \\"Probably some math stuff idk\\",\\n ),\\n)\\n
\\nThen the terms are passed as a list to register-glossary
#register-glossary(entry-list)\\n
\\nNow, you can display the glossary using the print-glossary
function.
#print-glossary(entry-list)\\n
\\nBy default, the terms that are not referenced in the document are not shown in the glossary, you can force their appearance by setting the show-all
argument to true.
You can also disable the back-references by setting the parameter disable-back-references
to true
.
By default, group breaks use linebreaks
. This behaviour can be changed by setting the user-group-break
parameter to pagebreak()
, or colbreak()
, or any other function that returns the content
you want.
You can call this function from anywhere in your document.
\\nReferencing terms is done using the key of the terms using the gls
function or the reference syntax.
// referencing the OIDC term using gls\\n#gls(\\"oidc\\")\\n// displaying the long form forcibly\\n#gls(\\"oidc\\", long: true)\\n\\n// referencing the OIDC term using the reference syntax\\n@oidc\\n
\\nYou can use the glspl
function and the references supplements to pluralize terms.\\nThe plural
key will be used when short
should be pluralized and longplural
will be used when long
should be pluralized. If the plural
key is missing then glossarium will add an \'s\' at the end of the short form as a fallback.
#glspl(\\"potato\\")\\n
\\nPlease look at the examples regarding plurals.
\\nYou can also override the text displayed by setting the display
argument.
#gls(\\"oidc\\", display: \\"whatever you want\\")\\n
\\nI recommend setting a show rule for the links to that your readers understand that they can click on the references to go to the term in the glossary.
\\n#show link: set text(fill: blue.darken(60%))\\n// links are now blue !\\n
\\n","description":"[!TIP] Glossarium is based in great part of the work of Sébastien d\'Herbais de Thun from his master thesis available at: https://github.com/Dherse/masterproef. His glossary is available under the MIT license here. Glossarium is a simple, easily customizable typst glossary…","guid":"https://typst.app/universe/package/glossarium","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-29T08:28:54.618Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/glossarium/0.5.1/.github/example.png","type":"photo"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"universal-cau-thesis (0.1.0) | 中国农业大学毕业论文的Typst模板","url":"https://typst.app/universe/package/universal-cau-thesis","content":"因为语法足够简单(简单易学)、编译器体积小(随取随用)、且速度足够快(实时预览)!
\\n本模板参考中国农业大学毕业论文模板要求编写,符合学校要求。对于其中一些可以灵活修改的格式,本模板也提供了配置项,具体详见模板使用方法。模板的效果见sample.pdf
文件:点击直达
⚠️ 但是,本模板为个人编写使用,没有完全适配自动化逻辑和模块化代码,可能仍旧存在部分情况排版不合理。如果您在使用过程中遇到问题,可以提交issue说明,也欢迎pull request贡献。
\\n如果该模板对您有帮助并愿意支持我的工作,可以在这里buy me a coffee,十分感谢😊!
\\nTypst可以使用线上WebApp或本地下载编译器后进行编写,本地编写需要下载安装编译器到本地,并将exe
格式的编译器添加到环境变量,以方便调用
下载该仓库到本地目录或WebApp的工作目录中,可以使用git命令或该页面上方的Code按钮直接下载
\\ngit clone https://github.com/JWangL5/CAU-ThesisTemplate-Typst.git\\n
\\n安装本模板所使用的相关字体(/fonts
文件夹内字体)
PS:受限于中文字体的衬线问题,目前版本的Typst暂不支持多数中文字体的加粗,这里使用了其他加粗字体作为替代,可以直接双击字体文件打开后安装
\\n本地编写时,建议使用vscode及Typst配套插件(Typst-LSP、Typst Preview)
\\n通过编写main.typ
文件完成论文的撰写,在该文件中,使用import
命令引入模板,并修改配置项
\\"本科\\"
,\\"硕士\\"
,\\"博士\\"
,其会对应修改封面和页眉处的信息[text]
内,使用\\\\
换行[text]
,也可以\\"text\\"
[理学硕士]
true
时添加草稿水印,用以区分是否为最终版本,填写false
时去除水印并添加论文章true
时隐藏封面上的相关信息,以及致谢和作者介绍使用typst
命令生成pdf格式文件,或直接使用vscode的实时预览插件(默认快捷键ctrl+k v
)
typst compile ./sample.typ\\n
\\n\\n\\n如果在使用Typst时遇到任何问题,都可以参考官方帮助文档,下面是简要的使用方法及与本模板相关的配套设置,可以参考的示例文档
\\nsample.typ
关于标题:Typst使用=
作为标题的指示符。本模板中,一级标题需要手动编号,二、三级标题则不需要
= 第一章 一级标题\\n== 二级标题\\n=== 三级标题\\n
\\n段落的编写:直接输入文本即可编写内容,使用两个回车另起一段
\\n这是内容的第一段,\\n这仍旧是第一段的内容\\n\\n多一个换行符号后另起为第二段\\n
\\n文字内容的基础格式:使用*text*
包括住的文字可以加粗,使用_text_
包括住的文字可以斜体文字,使用#u[text]
包括住的文字可以实现下划线,使用#sub[text]
包括住的文字修改为下标,使用#super[text]
包括住的文字修改为上标
这里是*加粗文字*内容,\\n这里是_斜体文字_内容,\\n这里是#u[下划线文字]内容,\\n这里是#sub[下标文字]内容,\\n这里是#super[上标文字]内容\\n
\\n使用#highlight(fill: red)[text]
高亮文字标记,使用fill
参数修改高亮颜色
这一段文字#highlight[还需要修改]\\n
\\n使用#link(\\"your link here\\")[text]
标记超链接
这里是#link(\\"https://typst.app/home\\")[Typst官方网站]\\n
\\n使用-
或+
使用无序列表或有序列表,使用Tab
缩进为二级列表
- 无序列表1\\n + 有序列表1\\n + 有序列表2\\n- 无序列表2\\n
\\n使用#h(2em)
或#v(1em)
来添加水平或垂直的空白缩进,括号中的参数为需要空出的距离,其单位可以使用%
(页面百分比),pt
(点,印刷行业的绝对长度单位,相当于1/72英寸),em
(字符长度,相对于当前字符大小)等
#h(2em)默认格式会首行缩进两字符,额外添加会再次缩进\\n
\\n模板支持自动汇总图表目录,可以使用#figure(image())
命令来添加图片或使用#booktab()
添加表格,在填写既定的配置项后可成功渲染并自动汇总目录页,可以使用@
引用图表
#figure(\\n image(\'./image/path.jpg\', width: 90%),\\n kind: image, \\n supplement: [图],\\n caption: [图片的标题],\\n)<img1>\\n\\n#booktab(\\n width:60%,\\n columns: (20%, 1fr, 2fr, 3fr),\\n caption: [这里填写表格名称],\\n kind: table, \\n [1], [2], [3], [4],\\n [a], [b], [c], [d],\\n [e], [f], [g], [h],\\n [i], [j], [k], [l]\\n)<tab1>\\n
\\n使用$
编写数学公式,$
符紧跟内容时为行内公式,添加空格后为行间公式,公式的具体规则和符号可以查帮助文档
泰勒展开式(行内):\\n$f(x)= sum_(n=0)^(infinity) (f^(n)(x_0))/(n!) (x-x_0)^n$\\n\\n欧拉公式(行间):\\n$ e^(i theta) = cos theta + i sin theta \\\\ e^i pi + 1 = 0 $\\n
\\n使用```code```
标识符输入代码,Typst可以渲染、显示代码框,如果指定了语言类型,可以根据其语法格式进行风格渲染;使用单个符号使用行内代码
```python\\n print(\\"hello world\\");\\n ```\\n同样支持行内代码`hello world`\\n
\\n修改ref\\\\acronyms.json
文件添加缩略词表,并使用#acro(\\"keyword1\\")
命令在文中引入缩略词全称,在引入后会自动根据json文件中信息,排序后添加到缩略词表中
{\\n \\"keyword1\\":[\\"英文缩写1\\", \\"英文全称1\\", \\"中文翻译1\\"],\\n \\"keyword2\\":[\\"英文缩写2\\", \\"英文全称2\\", \\"中文翻译2\\"]\\n}\\n
\\n在正文中可以使用`#acro`命令引入缩略词(#acro(\\"ac\\"))。\\n
\\n使用#[bibliography]()
添加参考文献,括号中需要填写.bib
格式的参考文献列表,在文中使用@citationKey
引用,具体的信息见帮助文档
PS:可以使用zotero+Better BibTex
自动导出/更新.bib
格式的参考文献列表
PS:在添加bib的代码后面,隐藏了一个heading,请不要删除这一行,否则参考文献的页眉会出错
\\nPS:根据学院要求默认使用EmboJ的格式,如果需要其他格式,只要下载到格式说明.csl
文件修改参数即可
当文本内容仅有1页时,有时页眉标题会出错,可以添加一个空白标题进行修正
\\n#heading(level: 6, numbering: none, outlined: false)[]\\n
\\n本模板在编写过程中参考并学习了Typst模板的部分代码,在这里统一致谢。
\\n","description":"为什么使用Typst 因为语法足够简单(简单易学)、编译器体积小(随取随用)、且速度足够快(实时预览)!\\n\\n关于本论文模板\\n\\n本模板参考中国农业大学毕业论文模板要求编写,符合学校要求。对于其中一些可以灵活修改的格式,本模板也提供了配置项,具体详见模板使用方法。模板的效果见sample.pdf文件:点击直达\\n\\n⚠️ 但是,本模板为个人编写使用,没有完全适配自动化逻辑和模块化代码,可能仍旧存在部分情况排版不合理。如果您在使用过程中遇到问题,可以提交issue说明,也欢迎pull request贡献。\\n\\n如果该模板对您有帮助并愿意支持我的工作,可以在这里buy me…","guid":"https://typst.app/universe/package/universal-cau-thesis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-27T11:24:51.205Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/universal-cau-thesis/0.1.0/images/PixPin_2024-03-13_17-19-53.png","type":"photo","width":2880,"height":1704}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"mino (0.1.2) | Render tetris fumen in typst.","url":"https://typst.app/universe/package/mino","content":"Render tetris fumen in typst!
\\n#import \\"typst-package/lib.typ\\": decode-fumen, render-field\\n// Uncomment the following line to use the mino from the official package registry\\n// #import \\"@preview/mino:0.1.1\\": decode-fumen, render-field\\n#set page(margin: 1.5cm)\\n\\n#align(center)[\\n #text(size: 25pt)[\\n DT Cannon\\n ]\\n]\\n\\n#let fumen = decode-fumen(\\"v115@vhPJHYaAkeEfEXoC+BlvlzByEEfE03k2AlP5ABwfAA?A+rQAAqsBsqBvtBTpBVhQeAlvlzByEEfE03k2AlP5ABwvDf?E33ZBBlfbOBV5AAAOfQeAlvlzByEEfE03+2BlP5ABwvDfEV?5k2AlPJVBjzAAA6WQAAzdBpeB0XBXUBFlQnAlvlzByEEfE0?3+2BlP5ABwvDfEXhWEBUYPNBkkuRA1GCLBUupAAdqQnAlvl?zByEEfE038UBlP5ABwvDfEXhWEBUYPNBkkuRA1GCLBU+rAA?AAPAA\\")\\n\\n#for i in range(fumen.len()) {\\n let field = fumen.at(i).at(\\"field\\")\\n [\\n #box[\\n #render-field(field, rows: 8, cell-size: 13pt) \\n (#(i+1))\\n #fumen.at(i).comment\\n ]\\n #h(0.5pt)\\n ]\\n}\\n\\n
\\ndecode-fumen
Decode a fumen string into a series of pages.
\\ndata
: str
- The fumen string to decodeThe pages, of type Array<{ field: Array<string, 20>, comment: string }>
.
(\\n (\\n field: (\\n \\"....\\",\\n \\"....\\",\\n ...\\n ),\\n comment: \\"...\\"\\n ),\\n ...\\n)\\n
\\nrender-field
field
: array
of str
- The field to renderrows
: number
- The number of rows to render, default to 20
cell-size
: length
- The size of each cell, default to 10pt
bg-color
: color
- The background color, default to #f3f3ed
stroke
: The stroke for the field, default to none
radius
: The border radius for the field, default to 0.25 * cell-size
shadow
: Whether to show shadow for cells, default to true
highlight
: Whether to highlight cells, default to true
color-data
: The color data for the field, default to default-color-data
:overdraw
: (default, 5) Draw each cell multiple times to avoid thin lines between cells. See https://github.com/linebender/vello/issues/49#let default-color = (\\n \\"Z\\": rgb(\\"#ef624d\\"),\\n \\"S\\": rgb(\\"#66c65c\\"),\\n \\"L\\": rgb(\\"#ef9535\\"),\\n \\"J\\": rgb(\\"#1983bf\\"),\\n \\"T\\": rgb(\\"#9c27b0\\"),\\n \\"O\\": rgb(\\"#f7d33e\\"),\\n \\"I\\": rgb(\\"#41afde\\"),\\n \\"X\\": rgb(\\"#686868\\")\\n)\\n
\\nhighlight-color-data
: The highlight color data for the field, default to default-highlight-color
:#let default-highlight-color = (\\n \\"Z\\": rgb(\\"#ff9484\\"),\\n \\"S\\": rgb(\\"#88ee86\\"),\\n \\"L\\": rgb(\\"#ffbf60\\"),\\n \\"J\\": rgb(\\"#1ba6f9\\"),\\n \\"T\\": rgb(\\"#e56add\\"),\\n \\"O\\": rgb(\\"#fff952\\"),\\n \\"I\\": rgb(\\"#43d3ff\\"),\\n \\"X\\": rgb(\\"#949494\\")\\n)\\n
\\nshadow-color
: The shadow color for the field, default to #6f6f6f17
The styles and color scheme are inspired by four.lol
\\n","description":"Render tetris fumen in typst! #import \\"typst-package/lib.typ\\": decode-fumen, render-field\\n// Uncomment the following line to use the mino from the official package registry\\n// #import \\"@preview/mino:0.1.1\\": decode-fumen, render-field\\n#set page(margin: 1.5cm)\\n\\n#align(center)[…","guid":"https://typst.app/universe/package/mino","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-27T08:37:58.310Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/mino/0.1.2/mino.svg","type":"photo","width":1240,"height":1440}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"metro (0.3.0) | Typset units and numbers with options.","url":"https://typst.app/universe/package/metro","content":"The Metro package aims to be a port of the Latex package siunitx. It allows easy typesetting of numbers and units with options. This package is very early in development and many features are missing, so any feature requests or bug reports are welcome!
\\nMetro’s name comes from Metrology, the study scientific study of measurement.
\\nBug reports, feature requests, and PRs are welcome!
\\nRequires Typst v0.11.0+.\\nUse Typst\'s package manager:
\\n#import \\"@preview/metro:0.3.0\\": *\\n
\\nYou can also download the src
folder and import lib.typ
and import:
#import \\"src/lib.typ\\": *\\n
\\nSee the manual for more detailed information: manual.pdf
\\nPostercise allows users to easily create academic research posters with different themes using Typst.
\\n\\n
\\n
You can get Postercise from the official package repository by entering the following.
\\n#import \\"@preview/postercise:0.1.0\\": *\\n
\\nAnother option is to use Postercise as a local module by downloading the package files into your project folder.
\\nNext you will need to import a theme, set up the page and font, and call the show
command.
#import themes.basic: *\\n\\n#set page(width: 24in, height: 18in)\\n#set text(size: 24pt)\\n\\n#show: theme\\n
\\nTo add content to the poster, use the poster-content
command.
#poster-content()[\\n // Content goes here\\n]\\n
\\nThere are a few options for types of content that should be added inside the poster-content
. The body of the poster can be typed as normal, or two box styles are provided to headings and/or highlight content in special ways.
#normal-box[]\\n#focus-box[]\\n
\\nBasic information like title and authors is placed as options using the poster-header
script.
#poster-header(\\n title: [Title],\\n authors: [Author],\\n)\\n
\\nFinally, additional content can be added to the footer with the poster-footer
script.
#poster-footer[]\\n
\\nAgain, as a reminder, all of these scripts should be called from inside of the poster-content
block.
Using these commands, it is easy to produce posters like the following:\\n
themes
Currently, 3 themes are available. Use one of these import
commands to load that theme.
#import themes.basic: *\\n#import themes.better: *\\n#import themes.boxes: *\\n
\\nshow: theme.with()
Theme options allow you to adjust the color scheme, as well as the color and size of the content in the header. The defaults are shown below. (The \'better.typ\' theme defaults to different titletext color and size.)
\\n#show: theme.with(\\n primary-color: rgb(28,55,103), // Dark blue\\n background-color: white,\\n accent-color: rgb(243,163,30), // Yellow\\n titletext-color: white,\\n titletext-size: 2em,\\n)\\n
\\nposter-content()[]
The only option for the main content is the number of columns. This defaults to 3 for most themes. For the \\"better.typ\\" theme, there is 1 column and content is placed in the leftmost column below poster-header
.
#poster-content(col: 3)[\\n // Content goes here\\n]\\n
\\nnormal-box()[]
and focus-box()[]
By default, these boxes use the no fill and the accent-color fill, respectively. However, they do accept color as an option, and will add a primary-color stroke around the box if a color is given. For the \\"better.typ\\" theme, use focus-box
to place content in the center column.
#normal-box(color: none)[\\n // Content\\n]\\n\\n#focus-box(color: none)[\\n // Content\\n]\\n
\\nposter-header()
Available options for the poster header for most themes are shown below. Note that logos should be explicitly labeled as images. Logos are not currently displayed in the header in the \\"better.typ\\" theme.
\\n#poster-header(\\n title: [Title],\\n subtitle: [Subtitle],\\n author: [Author],\\n affiliation: [Affiliation],\\n logo-1: image(\\"placeholder.png\\")\\n logo-2: image(\\"placeholder.png\\") \\n)\\n
\\nposter-footer[]
This command does not currently have any extra options. The content is typically placed at the bottom of the poster, but it is placed in the rightmost column for the \\"better.typ\\" theme.
\\n#poster-footer[\\n // Content\\n]\\n
\\nA simple way to create network protocol headers, memory maps, register definitions and more in typst.
\\n⚠️ Warning. As this package is still in an early stage, things might break with the next version.
\\nℹ️ If you find a bug or a feature which is missing, please open an issue and/or send an PR.
\\n#import \\"@preview/bytefield:0.0.6\\": *\\n\\n#bytefield(\\n// Config the header\\nbitheader(\\n\\"bytes\\",\\n// adds every multiple of 8 to the header.\\n0, [start], // number with label\\n5,\\n// number without label\\n12, [#text(14pt, fill: red, \\"test\\")],\\n23, [end_test],\\n24, [start_break],\\n36, [Fix], // will not be shown\\nangle: -50deg, // angle (default: -60deg)\\ntext-size: 8pt, // length (default: global header_font_size or 9pt)\\n),\\n// Add data fields (bit, bits, byte, bytes) and notes\\n// A note always aligns on the same row as the start of the next data field.\\nnote(left)[#text(16pt, fill: blue, font: \\"Consolas\\", \\"Testing\\")],\\nbytes(3,fill: red.lighten(30%))[Test],\\nnote(right)[#set text(9pt); #sym.arrow.l This field \\\\ breaks into 2 rows.],\\nbytes(2)[Break],\\nnote(left)[#set text(9pt); and continues \\\\ here #sym.arrow],\\nbits(24,fill: green.lighten(30%))[Fill],\\ngroup(right,3)[spanning 3 rows],\\nbytes(12)[#set text(20pt); *Multi* Row],\\nnote(left, bracket: true)[Flags],\\nbits(4)[#text(8pt)[reserved]],\\nflag[#text(8pt)[SYN]],\\nflag(fill: orange.lighten(60%))[#text(8pt)[ACK]],\\nflag[#text(8pt)[BOB]],\\nbits(25, fill: purple.lighten(60%))[Padding],\\n// padding(fill: purple.lighten(40%))[Padding],\\nbytes(2)[Next],\\nbytes(8, fill: yellow.lighten(60%))[Multi break],\\nnote(right)[#emoji.checkmark Finish],\\nbytes(2)[_End_],\\n)\\n
\\nTo use this library through the Typst package manager import bytefield with #import \\"@preview/bytefield:0.0.6\\": *
at the top of your file.
The package contains some of the most common network protocol headers which are available under: common.ipv4
, common.ipv6
, common.icmp
, common.icmpv6
, common.dns
, common.tcp
, common.udp
.
Here is a unsorted list of features which is possible right now.
\\nbit
, bits
, byte
or bytes
function.\\nnote
or group
function.bitheader
function. !Only one header per bytefield is processed currently.\\nmsb:left
or msb:right
(default)See example.typ for more information.
\\nSee CHANGELOG.md
\\n","description":"A simple way to create network protocol headers, memory maps, register definitions and more in typst. ⚠️ Warning. As this package is still in an early stage, things might break with the next version.\\n\\nℹ️ If you find a bug or a feature which is missing, please open an issue and/or…","guid":"https://typst.app/universe/package/bytefield","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-24T07:36:36.737Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/bytefield/0.0.6/docs/bytefield_example.png","type":"photo"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"tuhi-exam-vuw (0.1.0) | A poster template for VUW exams.","url":"https://typst.app/universe/package/tuhi-exam-vuw","content":"A Typst template for VUW exams. To get started:
\\ntypst init @preview/tuhi-exam-vuw:0.1.0\\n
\\nAnd edit the main.typ
example.
PRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.
\\n","description":"A Typst template for VUW exams. To get started: typst init @preview/tuhi-exam-vuw:0.1.0\\n\\n\\nAnd edit the main.typ example.\\n\\nContributing\\n\\nPRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.","guid":"https://typst.app/universe/package/tuhi-exam-vuw","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-24T07:35:06.083Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/tuhi-exam-vuw/0.1.0/thumbnail.png","type":"photo","width":1050,"height":1484}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"modern-ysu-thesis (0.1.0) | 燕山大学学位论文模板。Modern Yanshan University Thesis.","url":"https://typst.app/universe/package/modern-ysu-thesis","content":"本模板在modern-nju-thesis的基础上修改而来
\\n\\n\\n[!WARNING]
\\n本模板正处于积极开发阶段,存在一些格式问题,适合尝鲜 Typst 特性
\\n本模板是民间模板,可能不被学校认可,正式使用过程中请做好随时将内容迁移至 Word 或 LaTeX 的准备
\\n
clone 本项目后,照着 template\\\\thesis.typ 下写就行
\\nThis project is licensed under the MIT License.
\\n","description":"本模板在modern-nju-thesis的基础上修改而来 [!WARNING]\\n\\n本模板正处于积极开发阶段,存在一些格式问题,适合尝鲜 Typst 特性\\n\\n本模板是民间模板,可能不被学校认可,正式使用过程中请做好随时将内容迁移至 Word 或 LaTeX 的准备\\n\\nclone 本项目后,照着 template\\\\thesis.typ 下写就行\\n\\n致谢\\n感谢 modern-nju-thesis Typst 中文论文模板。\\nLicense\\n\\nThis project is licensed under the MIT License.","guid":"https://typst.app/universe/package/modern-ysu-thesis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-24T07:33:38.522Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"genealotree (0.1.0) | A package to draw genealogical trees, based on CeTZ","url":"https://typst.app/universe/package/genealotree","content":"Genealotree is a typst package to draw genealogical trees.\\nIt is developped at https://codeberg.org/drloiseau/genealogy. This is the place you can get the developpement version and send issues and pull requests.
\\nThis package is based on CeTZ and it provides functions to draw genealogical trees. It is oriented towards medical genealogy to study genetic disorders inheritance, but you might be able to use it to draw your family tree.
\\nFeatures :
\\nLimitations :
\\nTo be implemented :
\\nSee example.typ for a simple usage example, and the manual for precise references at manual.pdf
\\nThe steps to produce a tree are :
\\n#import \\"@preview/genealotree:0.1.0\\": *\\n#import \\"@preview/cetz:0.2.2\\": canvas\\n
\\nlet my-geneal = genealogy-init()\\n
\\nlet my-geneal = add-persons(\\n my-geneal,\\n (\\n \\"I1\\": (sex: \\"m\\"),\\n \\"I2\\": (sex: \\"f\\"),\\n \\"II1\\": (sex: \\"f\\"),\\n )\\n)\\n
\\nlet my-geneal = add-unions(\\n my-geneal,\\n ((\\"I1\\", \\"I2\\"), (\\"II1\\",))\\n)\\n
\\n#canvas(length: 0.4cm, {\\n draw-tree(my-geneal)\\n})\\n
\\n","description":"Genealotree is a typst package to draw genealogical trees. It is developped at https://codeberg.org/drloiseau/genealogy. This is the place you can get the developpement version and send issues and pull requests. This package is based on CeTZ and it provides functions to draw…","guid":"https://typst.app/universe/package/genealotree","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-23T13:55:17.214Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/genealotree/0.1.0/examples/example.jpg","type":"photo","width":612,"height":499}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"vercanard (1.0.2) | A colorful CV template","url":"https://typst.app/universe/package/vercanard","content":"A colorful resume template for Typst.
\\nThe demo file showcases what it is possible to do.\\nYou can see the result in the corresponding PDF.
\\nFirst of all, copy the template to your Typst project, and import it.
\\n#import \\"@preview/vercanard:1.0.2\\": *\\n
\\nThen, call the resume
in a global show
rule function to use it.\\nThis function takes a few arguments that we explain in comments below:
#show: resume.with(\\n // The title of your resume, generally your name\\n name: \\"Your name\\",\\n // The subtitle, which is the position you are looking for most of the time\\n title: \\"What you are looking for\\",\\n // The accent color to use (here a vibrant yellow)\\n accent-color: rgb(\\"f3bc54\\"),\\n // the margins (only used for top and left page margins actually,\\n // but the other ones are proportional)\\n margin: 2.6cm,\\n // The content to put in the right aside block\\n aside: [\\n = Contact\\n\\n // lists in the aside are right aligned\\n - #link(\\"mailto:example@example.org\\")\\n - +33 6 66 66 66 66\\n ]\\n)\\n\\n// And finally the main body of your resume can come here\\n
\\nWhen writing the body, you can use level-1 headings as section titles,\\nand format an entry with the entry
function (that takes three content\\nblocks as arguments, for title, description and details).
= Personal projects\\n\\n#entry[Vercanard][A resume template for Typst][2023 — Typst]\\n
\\nThis template is under the GPLv3 licence, but resume built\\nusing it are not considered binary derivatives, only output\\nfrom another program, so you can keep full copyright on them\\nand chose not to licence them under a free licence.
\\n","description":"A colorful resume template for Typst. The demo file showcases what it is possible to do. You can see the result in the corresponding PDF.\\n\\nFirst of all, copy the template to your Typst project, and import it.\\n\\n#import \\"@preview/vercanard:1.0.2\\": *\\n\\n\\nThen, call the resume in a…","guid":"https://typst.app/universe/package/vercanard","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-23T12:43:24.969Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"boxr (0.1.0) | A modular, and easy to use, package for creating cardboard cutouts in Typst.","url":"https://typst.app/universe/package/boxr","content":"Boxr is a modular, and easy to use, package for creating cardboard cutouts in Typst.
\\nCreate a boxr structure in your project with the following code:
\\n#import \\"@preview/boxr:0.1.0\\": *\\n\\n#render-structure(\\n \\"box\\",\\n width: 100pt,\\n height: 100pt,\\n depth: 100pt,\\n tab-size: 20pt,\\n [\\n Hello from boxr!\\n ]\\n)\\n
\\nThe render-structure
function is the main function for boxr. It either takes a path to one of the default structures provided by boxr (e.g.: \\"box\\"
) or an unpacked json file with your own custom structure (e.g.: json(my-structure.json)
). These describe the structure of the cutout.
\\nThe other named arguments depend on the structure you are rendering. All unnamed arguments are passed to the structure as content and will be rendered on each box face (not triangles or tabs).
Structures are defined in .json
files. An example structure that just shows a box with a tab on one face is shown below:
{\\n \\"variables\\": [\\"height\\", \\"width\\", \\"tab-size\\"],\\n \\"width\\": \\"width\\",\\n \\"height\\": \\"height + tab-size\\",\\n \\"offset-x\\": \\"\\",\\n \\"offset-y\\": \\"tab-size\\",\\n \\"root\\": {\\n \\"type\\": \\"box\\",\\n \\"id\\": 0,\\n \\"width\\": \\"width\\",\\n \\"height\\": \\"height\\",\\n \\"children\\": {\\n \\"top\\": \\"tab(tab-size, tab-size)\\"\\n }\\n }\\n}\\n
\\nThe variables
key is a list of variable names that can be passed to the structure. These will be required to be passed to the render-structure
function.
\\nThe width
and height
keys are evaluated to calculate the width and height of the structure.
\\nThe offset-x
and offset-y
keys are evaluated to place the structure in the middle of its bounds. It is relative to the root node. In this case for example, the top tab adds a tab-size
on top of the box as opposed to the bottom, where there is no tab. So this tab-size
is added to the offset-y
.
\\nroot
denotes the first node in the structure.
\\nA node can be of the following types:
box
:\\nwidth
and a height
. All following nodes have a size
. Child nodes use size
and the parent node\'s width
and height
to calculate their own width and height.children
nodes.id
key that is used to place content on the face of the box. The id-th unnamed argument is placed on the face. Multiple faces can have the same id.no-fold
key. If this exists, no fold stroke will be drawn between this box and its parent.triangle-<left|right>
:\\nwidth
and height
.left
and right
denote the direction the other right angled line is facing relative to the base.children
nodes.no-fold
key. If this exists, no fold stroke will be drawn between this triangle and its parent.tab
:\\n()
separted by a ,
.none
:\\nEvery string value in the json file (width: \\"__\\", height: \\"__\\", ... offset-x/y: \\"__\\"
and the values between the |
for tabs) is evaluated as regular typst code. This means that you can use all named variables passed to the structure. All inputs are converted to points and the result of the evaluation will be converted back to a length.
\\n\\nMANuals for TYpSt
\\n
Template for documenting typst packages and templates.
\\nJust import the package at the beginning of your manual:
\\n#import \\"@preview/mantys:0.1.4\\": *\\n
\\nMantys supports Typst 0.11.0 and newer.
\\nA basic template for a manual could look like this:
\\n#import \\"@local/mantys:0.1.4\\": *\\n\\n#import \\"your-package.typ\\"\\n\\n#show: mantys.with(\\nname:\\"your-package-name\\",\\ntitle: [A title for the manual],\\nsubtitle: [A subtitle for the manual],\\ninfo:[A short descriptive text for the package.],\\nauthors:\\"Your Name\\",\\nurl:\\"https://github.com/repository/url\\",\\nversion:\\"0.0.1\\",\\ndate:\\"date-of-release\\",\\nabstract: [\\nA few paragraphs of text to describe the package.\\n],\\n\\nexample-imports: (your-package: your-package)\\n)\\n\\n// end of preamble\\n\\n# About\\n#lorem(50)\\n\\n# Usage\\n#lorem(50)\\n\\n# Available commands\\n#lorem(50)\\n\\n
\\nUse #command(name, ..args)[description]
to describe commands and #argument(name, ...)[description]
for arguments:
#command(\\"headline\\", arg[color], arg(size:1.8em), sarg[other-args], barg[body])[\\nRenders a prominent headline using #doc(\\"meta/heading\\").\\n\\n#argument(\\"color\\", type:\\"color\\")[\\n The color of the headline will be used as the background of a #doc(\\"layout/block\\") element containing the headline.\\n ]\\n #argument(\\"size\\", default:1.8em)[\\n The text size for the headline.\\n ]\\n #argument(\\"sarg\\", is-sink:true)[\\n Other options will get passed directly to #doc(\\"meta/heading\\").\\n ]\\n #argument(\\"body\\", type:\\"content\\")[\\n The text for the headline.\\n ]\\n\\n The headline is shown as a prominent colored block to highlight important news articles in the newsletter:\\n\\n #example[```\\n #headline(blue, size: 2em, level: 3)[\\n #lorem(8)\\n ]\\n ```]\\n]\\n
\\nThe result might look something like this:
\\nFor a full reference of available commands read the manual.
\\n#lambda
now uses #dtype
scope
argument for eval
in examples.\\n#example()
, #side-by-side()
and #shortex()
now support the scope
and mode
argument.example-imports
was replaced by examples-scope
.typst.toml
file directly into #mantys
:#show: mantys.with( ..toml(\\"typst.toml\\") )\\n
\\n#version(since:(), until:())
command to add version markers to commands.theme.typ
file to allow easy customization of colors and styles.#func()
, #lambda()
and #symbol()
commands, to handle special cases for values.ttt-exam
is a template to create exams and belongs to the typst-teacher-tools-collection.
Run this command inside your terminal to init a new exam.
\\ntypst init @preview/ttt-exam my-exam\\n
\\nThis will scaffold the following folder structure.
\\nmy-exam/\\n├─ meta.toml\\n├─ exam.typ\\n├─ eval.typ\\n├─ justfile\\n└─ logo.jpg\\n
\\nReplace the logo.jpg
with your schools, university, ... logo or remove it. Then edit the meta.toml
.\\nEdit the exam.typ
and replace the questions with your own. If you like you can also remove the meta.toml
file and specify the values directly inside exam.typ
If you have installed just you can use it to build a student and teacher version of your exam by running just build
.
Here you can see an example with both versions. On the left the student version and on the right the teachers version.
\\nThe eval.typ
is a template for generating grade lists. You need to add your students to meta.toml
and add the total amount of points.
You can pass the following arguments to exam
#let exam(\\n // metadata \\n logo: none, // none | image\\n title: \\"exam\\", // the title of the exam\\n subtitle: none, // is shown below the title\\n date: none, // date of the exam, preferred type of datetime.\\n class: \\"\\", \\n subject: \\"\\" ,\\n authors: \\"\\", // string | array\\n // config\\n solution: auto, // if solutions are displayed can also be specified with `--input solution=true` on the cli.\\n cover: true, // true | false\\n header: auto, // true | false | auto\\n eval-table: false, // true | false\\n appendix: none, // content | none\\n)\\n
\\n","description":"ttt-exam is a template to create exams and belongs to the typst-teacher-tools-collection. Usage\\n\\nRun this command inside your terminal to init a new exam.\\n\\ntypst init @preview/ttt-exam my-exam\\n\\n\\nThis will scaffold the following folder structure.\\n\\nmy-exam/\\n├─ meta.toml\\n├─ exam.typ\\n├─…","guid":"https://typst.app/universe/package/ttt-exam","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-23T10:23:44.257Z","media":[{"url":"https://raw.githubusercontent.com/jomaway/typst-teacher-templates/blob/main/ttt-exam/thumbnail.png","type":"photo"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"unify (0.6.0) | Format numbers, units, and ranges correctly.","url":"https://typst.app/universe/package/unify","content":"unify
is a Typst package simplifying the typesetting of numbers, (physical and monetary) units, and ranges. It is the equivalent to LaTeX\'s siunitx
, though not as mature.
unify
allows flexible numbers and units, and still mostly gets well typeset results.
#import \\"@preview/unify:0.6.0\\": num,qty,numrange,qtyrange\\n\\n$ num(\\"-1.32865+-0.50273e-6\\") $\\n$ qty(\\"1.3+1.2-0.3e3\\", \\"erg/cm^2/s\\", space: \\"#h(2mm)\\") $\\n$ numrange(\\"1,1238e-2\\", \\"3,0868e5\\", thousandsep: \\"\'\\") $\\n$ qtyrange(\\"1e3\\", \\"2e3\\", \\"meter per second squared\\", per: \\"/\\", delimiter: \\"\\\\\\"to\\\\\\"\\") $\\n
\\nThe Unify package supports multiple languages. Currently, the supported languages are English and Russian. The fallback is English. If you want to add your language, you should add two files: prefixes-xx.csv
and units-xx.csv
, and in the lib.typ
file you should fix the lang-db
state for your files.
num
num
uses string parsing in order to typeset numbers, including separators between the thousands. They can have the following form:
float
or integer
number{}
stands for a number)\\n+-{}
+{}-{}
e{}
Parentheses are automatically set as necessary. Use thousandsep
to change the separator between the thousands, and multiplier
to change the multiplication symbol between the number and exponential.
unit
unit
takes the unit in words or in symbolic notation as its first argument. The value of space
will be inserted between units if necessary. Setting per
to symbol
will format the number with exponents (i.e. ^(-1)
), and fraction
or /
using fraction.
\\nUnits in words have four possible parts:
per
forms the inverse of the following unit.centi
). This is added before the unit.gram
).squared
. This is added after the unit and takes per
into account.The shorthand notation also has four parts:
\\n/
forms the inverse of the following unit.c
). This is added before the unit.g
).^2
. This is added after the unit and takes /
into account.Note: Use u
for micro.
The possible values of the three latter parts are loaded at runtime from prefixes.csv
, units.csv
, and postfixes.csv
(in the library directory). There, you can also add your own units. The formats for the pre- and postfixes are:
| pre-/postfix | shorthand | symbol |\\n| ------------ | --------- | ------------ |\\n| milli | m | upright(\\"m\\") |
\\nand for units:
\\n| unit | shorthand | symbol | space |\\n| ----- | --------- | ------------ | ----- |\\n| meter | m | upright(\\"m\\") | true |
\\nThe first column specifies the written-out word, the second one the shorthand. These should be unique. The third column represents the string that will be inserted as the unit symbol. For units, the last column describes whether there should be space before the unit (possible values: true
/false
, 1
,0
). This is mostly the cases for degrees and other angle units (e.g. arcseconds).
\\nIf you think there are units not included that are of interest for other users, you can create an issue or PR.
qty
qty
allows a num
as the first argument following the same rules. The second argument is a unit. If rawunit
is set to true, its value will be passed on to the result (note that the string passed on will be passed to eval
, so add escaped quotes \\\\\\"
if necessary). Otherwise, it follows the rules of unit
. The value of space
will be inserted between units if necessary, thousandsep
between the thousands, and per
switches between exponents and fractions.
numrange
numrange
takes two num
s as the first two arguments. If they have the same exponent, it is automatically factorized. The range symbol can be changed with delimiter
, and the space between the numbers and symbols with space
.
qtyrange
qtyrange
is just a combination of unit
and range
.
This is a Typst template for a minimalistic LaTeX-style CV. It provides a simple\\nstructure for a CV with a header, a section for professional experience, a section\\nfor education, and a section for skills and languages.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for minimalistic-latex-cv
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/minimalistic-latex-cv\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the cv
function with the following named arguments:
name
: The name of the person.metadata
: A dictionary of metadata of the person to be displayed in the header.photo
: The path to the photo of the person.lang
: The language of the document.The function also accepts a single, positional argument for the body of the\\npaper.
\\nThe template will initialize your package with a sample call to the cv
\\nfunction in a show rule. If you want to change an existing project to use this\\ntemplate, you can add a show rule like this at the top of your file:
#import \\"@preview/minimalistic-latex-cv:0.1.1\\": cv\\n\\n#show: cv.with(\\n name: \\"Your Name\\",\\n metadata: (\\n email: \\"your@email.com\\",\\n telephone: \\"+123456789\\",\\n ),\\n photo: image(\\"photo.jpeg\\"),\\n lang: \\"en\\",\\n)\\n\\n// Your content goes below.\\n
\\n","description":"This is a Typst template for a minimalistic LaTeX-style CV. It provides a simple structure for a CV with a header, a section for professional experience, a section for education, and a section for skills and languages. Usage\\n\\nYou can use this template in the Typst web app by…","guid":"https://typst.app/universe/package/minimalistic-latex-cv","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-23T09:18:26.933Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"autofletcher (0.1.1) | Easier diagrams with fletcher","url":"https://typst.app/universe/package/autofletcher","content":"This small module provides functions to (sort of) abstract away manual\\nplacement of coordinates.
\\nSee the manual\\nfor usage examples.
\\nThe iconic-salmon-svg
package is designed to help you create your curriculum vitae (CV). It allows you to easily reference your social media profiles with the typical icon of the service plus a link to your profile.
\\nThe package name is a combination of the acronym SociAL Media icONs and the word iconic because all these icons have an iconic design (and iconic also contains the word icon).
text
)You can install the library using the typst packages:
\\n#import \\"@preview/iconic-salmon-svg:1.0.0\\": *\\n
\\nPut the iconic-salmon-svg.typ
file in your project directory and import it:
#import \\"iconic-salmon-svg.typ\\": *\\n
\\n// #import \\"@preview/iconic-salmon-svg:1.0.0\\": github-info, gitlab-info\\n#import \\"iconic-salmon-svg.typ\\": github-info, gitlab-info\\n\\nThis project was created by #github-info(\\"Bi0T1N\\"). You can also find me on #gitlab-info(\\"GitLab\\", rgb(\\"#811052\\"), url: \\"https://gitlab.com/Bi0T1N\\").\\n
\\nSee the examples.typ
file for a complete example. The generated PDF files are also available for preview.
Feel free to open an issue or a pull request if you find any problems or have any suggestions.
\\nThis library is licensed under the MIT license. Feel free to use it in your project.
\\nProduct names, logos, brands and other trademarks referred to in this project are the property of their respective trademark holders.
\\nThese trademark holders are not affiliated with this Typst library, nor are the authors officially endorsed by them, nor do the authors claim ownership of these trademarks.
Create beautiful booklets with ease.
\\nThe current version of this library (0.3.0) contains a single function to take in an array of content blocks and order them into a ready to print booklet, bulletin, etc. No need to fight with printer settings or document converters.
\\nHere is an example of the output generated by the sig
function (short for a book\'s signature) with default parameters and some sample content:
Here is an example with some customization applied:
\\nsig
FunctionThe sig
function is used to create a signature (booklet) layout from provided content. It takes various parameters to automatically configure the layout.
page_margin_binding
: The binding margin for each page in the booklet (space between pages).page_border
: Takes a color space value to draw a border around each page. If set to none no border will be drawn.draft
: A boolean value indicating whether to output an unordered draft or final layout.p-num-layout
: A configuration for page numbering styles, allowing multiple layouts that apply to specified page ranges. Each layout can be provided as a dictonary specifying the following options:\\np-num-start
: Starting page number for this layoutp-num-alt-start
: Alternative starting page number (e.g., for chapters)p-num-pattern
: Pattern for page numbering (e.g., \\"1\\"
, \\"i\\"
, \\"a\\"
, \\"A\\"
)p-num-placment
: Placement of page numbers (top
or bottom
)p-num-align-horizontal
: Horizontal alignment of page numbers (left
, center
, or right
)p-num-align-vertical
: Vertical alignment of page numbers (top
, horizon
, or bottom
)p-num-pad-left
: Extra padding added to the left of the page numberp-num-pad-horizontal
: Horizontal padding for page numbersp-num-size
: Size of page numbersp-num-border
: The border color for the page numbers. If set to none no border will be drawn.p-num-halign-alternate
: A boolean for whether to alternate horizontal alignment between left and right pages.pad_content
: The padding around the page content.contents
: The content to be laid out in the booklet. This should be an array of blocks.To use the sig
function, first set your desired page settings using the native page function. Then simply call the sig function with the desired parameters and provide the content to be laid out in the booklet:
#set page(flipped: true, paper: \\"us-letter\\")\\n#bookletic.sig(\\n contents: [\\n [\\"Page 1 content\\"],\\n [\\"Page 2 content\\"],\\n [\\"Page 3 content\\"],\\n [\\"Page 4 content\\"],\\n ],\\n)\\n
\\nThis will create a signature layout with the provided content, using the default values for the other parameters.
\\nYou can customize the layout by passing different values for the various parameters. For example:
\\n#set page(flipped: true, paper: \\"us-legal\\", margin: (top: 1in, bottom: 1in, left: 1in, right: 1in))\\n#bookletic.sig(\\n page_margin_binding: 0.5in,\\n page_border: none,\\n draft: true,\\n p-num-layout: (\\n bookletic.num-layout(\\n p-num-start: 1,\\n p-num-alt-start: none,\\n p-num-pattern: \\"~ 1 ~\\", \\n p-num-placment: bottom,\\n p-num-align-horizontal: right,\\n p-num-align-vertical: horizon,\\n p-num-pad-left: -5pt,\\n p-num-pad-horizontal: 0pt,\\n p-num-size: 16pt,\\n p-num-border: rgb(\\"#ff4136\\"),\\n p-num-halign-alternate: false,\\n ),\\n ),\\n pad_content: 10pt,\\n contents: (\\n [\\"Page 1 content\\"],\\n [\\"Page 2 content\\"],\\n [\\"Page 3 content\\"],\\n [\\"Page 4 content\\"],\\n ),\\n)\\n
\\nThis will create an unordered draft signature layout with US Legal paper size, larger margins, no page borders, page numbers at the bottom right corner with a red border, and more padding around the content.
\\nsig
function is currently hardcoded to only handle two-page single-fold signatures. Other more complicated signatures may be supported in the future.num-layout
function is a helper to create page number layouts with default values.booklet
function is a placeholder for automatically breaking a single content block into pages dynamically. It is not implemented yet but will be added in coming versions.I would love to see this package eventually turn into a community effort. So any interest in collaboration is very welcome! You can find the github repository for this library here: Bookletic Repo. Feel free to file an issue, pull request, or start a discussion.
\\nnum-layout
function helper.Initial Commit
\\n","description":"Create beautiful booklets with ease. The current version of this library (0.3.0) contains a single function to take in an array of content blocks and order them into a ready to print booklet, bulletin, etc. No need to fight with printer settings or document converters.\\n\\nExample…","guid":"https://typst.app/universe/package/bookletic","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-23T08:53:15.096Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/bookletic/0.3.0/example/basic.png","type":"photo","width":904,"height":700,"blurhash":"LGS6Pl-;M{xuM{ayWBj[00ayayj["},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/bookletic/0.3.0/example/fancy.png","type":"photo","width":1150,"height":700,"blurhash":"L5Rp8--;01~q00M{-;xuD%M_-;Rj"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"riesketcher (0.2.1) | A package to draw Riemann sums (and their plots) of a function with CeTZ.","url":"https://typst.app/universe/package/riesketcher","content":"A package to draw Riemann sums (and their plots) of a function with CeTZ.
\\nUsage example and docs: manual.pdf
\\n#import \\"@preview/riesketcher:0.2.1\\": riesketcher\\n
\\n![]() | \\n![]() | \\n![]() | \\n
A package and template for drafting legislative content in a German-style structuring, such as for bylaws, etc.
\\nWhile the template is designed to be used in German documents, all strings are customizable. You can have a look at the delegis.typ
to see all available parameters.
While this README.md
gives you a brief overview of the package\'s usage, we recommend that you use the template (in the template
folder) as a starting point instead.
#import \\"@preview/delegis:0.3.0\\": *\\n
\\n#show: delegis.with(\\n // Metadata\\n title: \\"Vereinsordnung zu ABCDEF\\", // title of the law/bylaw/...\\n abbreviation: \\"ABCDEFVO\\", // abbreviation of the law/bylaw/...\\n resolution: \\"3. Beschluss des Vorstands vom 24.01.2024\\", // resolution number and date\\n in-effect: \\"24.01.2024\\", // date when it comes into effect\\n draft: false, // whether this is a draft\\n // Template\\n logo: image(\\"wuespace.jpg\\", alt: \\"WüSpace e. V.\\"), // logo of the organization, shown on the first page\\n)\\n
\\nSections are auto-detected as long as they follow the pattern § 1 ...
or § 1a ...
in its own paragraph:
§ 1 Geltungsbereich\\n\\n(1) \\nDiese Ordnung gilt für alle Mitglieder des Vereins.\\n\\n(2) \\nSie regelt die Mitgliedschaft im Verein.\\n\\n§ 2 Mitgliedschaft\\n\\n(1) \\nDie Mitgliedschaft im Verein ist freiwillig.\\n\\n(2) \\nSie kann jederzeit gekündigt werden.\\n\\n§ 2a Ehrenmitgliedschaft\\n\\n(1) \\nDie Ehrenmitgliedschaft wird durch den Vorstand verliehen.\\n
\\nAlternatively (or if you want to use special characters otherwise not supported, such as *
), you can also use the #section[number][title]
function:
#section[§ 3][Administrator*innen]\\n
\\nIf you want to add more structure to your sections, you can use normal Typst headings. Note that only the level 6 headings are reserved for the section numbers:
\\n= Allgemeine Bestimmungen\\n\\n§ 1 ABC\\n\\n§ 2 DEF\\n\\n= Besondere Bestimmungen\\n\\n§ 3 GHI\\n\\n§ 4 JKL\\n
\\nDelegis will automatically use a numbering scheme for the divisions that is in line with the \\"Handbuch der Rechtsförmlichkeit\\", Rn. 379 f. If you want to customize the division titles, you can do so by setting the division-prefixes
parameter in the delegis
function:
#show: delegis.with(\\n division-prefixes: (\\"Teil\\", \\"Kapitel\\", \\"Abschnitt\\", \\"Unterabschnitt\\")\\n)\\n
\\nIf a paragraph contains multiple sentences, you can number them by adding a #s~
at the beginning of the sentences:
§ 3 Mitgliedsbeiträge\\n\\n#s~Die Mitgliedsbeiträge sind monatlich zu entrichten.\\n#s~Sie sind bis zum 5. des Folgemonats zu zahlen.\\n
\\nThis automatically adds corresponding sentence numbers in superscript.
\\nReferencing works manually by specifying the section number. While automations would be feasible, we have found that in practice, they\'re not as useful as they might seem for legislative documents.
\\nIn some cases, referencing sections using § X
could be mis-interpreted as a new section. To avoid this, use the non-breaking space character ~
between the §
and the number:
§ 5 Inkrafttreten\\n\\nDiese Ordnung tritt am 24.01.2024 in Kraft. §~4 bleibt unberührt.\\n
\\n#metadata
fields for usage with typst query
. You can now use typst query file.typ \\"<field>\\" --field value --one
with <field>
being one of the following to query metadata fields in the command line:\\n<title>
<abbreviation>
<resolution>
<in-effect>
#section[§ 1][ABC]
function to enable previously unsupported special chars (such as *
) in section headings. Note that this was previously possible using #unnumbered[§ 1\\\\ ABC]
, but the new function adds a semantically better-fitting alternative to this fix.pandoc
, meaning it\'s now possible to use pandoc
to convert delegis documents to HTML, etc.[1]
to not collide with sentence numbers.str-draft
variable name that lead to draft documents resulting in a syntax error.Initial Release
\\n","description":"A package and template for drafting legislative content in a German-style structuring, such as for bylaws, etc.\\n\\nWhile the template is designed to be used in German documents, all strings are customizable. You can have a look at the delegis.typ to see all available…","guid":"https://typst.app/universe/package/delegis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-22T08:35:50.639Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/delegis/0.3.0/demo-1.png","type":"photo","width":839,"height":1191},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/delegis/0.3.0/demo-2.png","type":"photo","width":839,"height":1191},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/delegis/0.3.0/demo-3.png","type":"photo","width":839,"height":1191}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"ttt-utils (0.1.2) | A collection of tools to make a teachers life easier.","url":"https://typst.app/universe/package/ttt-utils","content":"ttt-utils
is the core package of the typst-teacher-tools collection.
It contains several modules:
\\nassignments
contains functions for creating exams.components
contains useful visual components such lines or caro pattern, tags, etc ...grading
contains functions for grading exams.helpers
contains some utility functions.layout
contains some layout functions such as side-by-side, etc...random
contains a function to shuffle an array.You can import the modules you need with:
\\n#import \\"@preview/ttt-utils:0.1.0\\": components\\n
\\nthen you can access the modules function with:
\\n#components.lines(4)
or #components.caro(5)
, ...
or import the wanted functions:
\\n#import \\"@preview/ttt-utils:0.1.0\\": components, assignments\\n\\n#import assignments: assignment, question, answer\\n#import components: caro as grid_pattern\\n\\n// Add a question.\\n\\n#assignment[First assignment\\n\\n #question[\\n #answer(field: grid_pattern(5))\\n ]\\n]\\n\\n
\\nassignment
module, but only questions without assignments, and a bit more low level. I adopted a few of his ideas.See CHANGELOG.md
\\n","description":"ttt-utils is the core package of the typst-teacher-tools collection. Modules\\n\\nIt contains several modules:\\n\\nassignments contains functions for creating exams.\\ncomponents contains useful visual components such lines or caro pattern, tags, etc ...\\ngrading contains functions for…","guid":"https://typst.app/universe/package/ttt-utils","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-22T08:33:27.764Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"athena-tu-darmstadt-thesis (0.1.0) | Thesis template for TU Darmstadt (Technische Universität Darmstadt).","url":"https://typst.app/universe/package/athena-tu-darmstadt-thesis","content":"This unofficial template can be used to write in Typst with the corporate design of TU Darmstadt.
\\nPlease ask your supervisor if you are allowed to use typst and this template for your thesis or other documents.\\nNote that this template is not checked by TU Darmstadt for correctness.\\nThus, this template does not guarantee completeness or correctness.\\nAlso, note that submission in TUbama requires PDF/A which typst currently can\'t export to (https://github.com/typst/typst/issues/2942).\\nYou can use a converter to convert from the typst output to PDF/A, but check that there are no losses during the conversion. CMYK color space support may be required for printing which is also currently not supported by typst (https://github.com/typst/typst/issues/2942), but this is not relevant when you just submit online.
\\nThe templates imitate the style of the corresponding latex templates in tuda_latex_templates.\\nNote that there can be visual differences between the original latex template and the typst template (you may open an issue when you find one).
\\nFor missing features, ideas or other problems you can just open an issue :wink:. Contributions are also welcome.
\\n| Template | Preview | Example | Scope |\\n|----------|---------|---------|-------|\\n| tudapub | | example_tudapub.pdf
example_tudapub.typ | Master and Bachelor thesis |
Create a new typst project based on this template locally.
\\ntypst init @preview/athena-tu-darmstadt-thesis\\ncd athena-tu-darmstadt-thesis\\n
\\nOr create a project on the typst web app based on this template.
\\nmkdir my_thesis && cd my_thesis\\nmkdir templates && cd templates\\ngit clone https://github.com/JeyRunner/tuda-typst-templates templates/\\n
\\nDownload the tud logo from download.hrz.tu-darmstadt.de/protected/ULB/tuda_logo.pdf and put it into the logos
folder.\\nNow execute the following script in the logos
folder to convert it into an svg:
cd logos\\n./convert_logo.sh\\n
\\nAlso download the required fonts Roboto
and XCharter
:
cd fonts\\n./download_fonts.sh\\n
\\nNow you can install all fonts in the folders in fonts
on your system.
#import \\" templates/tuda-typst-templates/templates/tudapub/tudapub.typ\\": tudapub\\n\\n#show: tudapub.with(\\n title: [\\n My Thesis\\n ],\\n author: \\"My Name\\",\\n accentcolor: \\"3d\\"\\n)\\n\\n= My First Chapter\\nSome Text\\n
\\ntypst --watch main.typ --font-path fonts/\\n
\\nThis will watch your file and recompile it to a pdf when the file is saved. For writing, you can use Vscode with these extensions: Typst LSP and Typst Preview. Or use the typst web app (here you need to upload the logo and the fonts).
\\nNote that we add --font-path
to ensure that the correct fonts are used.\\nDue to a bug (typst/typst#2917 typst/typst#2098) typst sometimes uses the font Roboto condensed
instead of Roboto
.\\nTo be on the safe side, double-check the embedded fonts in the pdf (there should be no Roboto condensed
).\\nWhat also works is to uninstall/deactivate all Roboto condensed
fonts from your system.
figure_numbering_per_chapter
.figure_numbering_per_chapter
This template was created for a master thesis at the faculty of computer science (FIN), but should work as well for other faculties.
\\n.\\n├── assets // Images, CSV-Files, etc. \\n│ └── figure // Image files\\n│ └── optimal-ovgu-thesis \\n├── chapter // Content\\n│ ├── 01-Einleitung.typ\\n│ ├── ...\\n│ └── 99-Appendix.typ\\n├── expose.typ // Exposé template\\n├── metadata.typ // Metadata and template config\\n├── thesis.bib // Bibliography (e.g. generated by Zotero + Better BibTex)\\n└── thesis.typ // Thesis template\\n
\\nThe header- and organisation-logo can be set in the metadata.typ
file (see example below). There are two example logo files in assets/figure/optimal-ovgu-thesis
. Please refer to cd.ovgu.de for more information regarding the OvGU corporate design and for the signet and logo of your faculty.
Header logos are set in metadata.typ
:
// Example 1: Use UCC logo as organisation-logo and the FIN faculty header as header-logo\\n#let organisation-logo = image(\\"assets/figure/optimal-ovgu-thesis/ucc.svg\\", width: 2cm)\\n#let header-logo = image(\\"assets/figure/optimal-ovgu-thesis/fin-de.svg\\", width: 100%)\\n\\n// Example 2: Do not use logos at all\\n#let organisation-logo = none\\n#let header-logo = none\\n
\\nThis template requires these two fonts to be installed on your system:
\\nIn your configuration.nix
:
fonts.packages = with pkgs; [\\n liberation_ttf # here are your other fonts (liberation is just an example)\\n ] ++ texlive.newcomputermodern.pkgs; # ← New Computer Modern font\\n
\\nIn case you want to contribute, check out the repo into a typst package directory
\\nLocal package path: ~/.local/share/typst/packages/local/optimal-ovgu-thesis/0.1.0
mkdir -p ~/.local/share/typst/packages/local/optimal-ovgu-thesis\\ncd ~/.local/share/typst/packages/local/optimal-ovgu-thesis\\ngit clone git@github.com:v411e/optimal-ovgu-thesis.git\\nmv optimal-ovgu-thesis 0.1.0\\n
\\nThis will make the package available locally, so you can use typst init \\"@local/optimal-ovgu-thesis:0.1.0\\"
to create a test-project from the template.
This is a Typst template for a rebuttal/response letter.\\nIt allows authors to respond to feedback given by reviewers in a peer-review process on a point-by-point basis.\\nThis template is based heavily on the LaTeX template from Zenke Lab (see here).
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for bamdone-rebuttal
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/bamdone-rebuttal\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the rebuttal
function with the following named arguments:
title
: (content), something like \\"Response Letter\\" (the default) or \\"Rebuttal\\".authors
: (content), list of author names\\nthe top of the first column in boldface.date
: (content), defaults to datetime.today().display()
paper-size
: Defaults to us-letter
. Specify a paper size\\nstring to\\nchange the page format.\\nSpecifying this will configure numeric, IEEE-style citations.The function also accepts a single, positional argument for the body of the\\nletter.
\\nIn addition, the template exports the configure
function which accepts the following named arguments corresponding to the text color of various pieces of the letter:
point-color
: defaults to blue.darken(30%)
, the text color for reviewers\' pointsresponse-color
: defaults to black
, the text color for the authors\' responsesnew-color
: defaults to green.darken(30%)
, the text color for changes/additions to the manuscript (i.e., within a quote
block to show what\'s changed from the initial submission)The template will initialize your package with a sample call to the rebuttal
\\nfunction in a show rule.
// Optional color configuration\\n#let (point, response, new) = configure(\\n point-color: blue.darken(30%),\\n response-color: black,\\n new-color: green.darken(30%)\\n)\\n\\n// Setup the rebuttal\\n#show: rebuttal.with(\\n authors: [First A. Author and Second B. Author],\\n // date: ,\\n // paper-size: ,\\n)\\n\\n// Your content goes below\\nWe thank the reviewers...\\n
\\n","description":"This is a Typst template for a rebuttal/response letter. It allows authors to respond to feedback given by reviewers in a peer-review process on a point-by-point basis. This template is based heavily on the LaTeX template from Zenke Lab (see here). Usage\\n\\nYou can use this…","guid":"https://typst.app/universe/package/bamdone-rebuttal","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-16T08:59:41.163Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"natrix (0.1.0) | Natural and consistent matrix for typst.","url":"https://typst.app/universe/package/natrix","content":"natrix.nat
is a drop-in replacement for mat
with some additional features. nat
ensures that each row in your matrix should have the similar height, unless one of them becomes too tall.
At this moment, it is recommended to use nat
only in display equations, but not in inline equations. This is because nat
looks a little bit off when used in inline equations.
nat
Every thing is the same as mat
in typst.
This package also provides bnat
, Bnat
, vnat
, Vnat
,
A Typst exam package based on the MIT LaTeX exam package
\\nmain.typ
#import \\"@preview/examit:0.1.1\\": *\\n#import \\"questions.typ\\": questions\\n\\n#show: examit.with(\\n questions: questions, // questions file, see example\\n\\n title: [examit],\\n subtitle: \\"A Typst Exam Package\\",\\n date: \\"2023-03-21\\",\\n\\n margin: (\\n left: 18mm,\\n top: 16mm,\\n bottom: 25mm,\\n right: 25mm,\\n ),\\n cols: 2,\\n gutter: 18mm,\\n lang: \\"en\\",\\n font: \\"New Computer Modern\\",\\n\\n extrapicturebox: true, // \\"If you have time...\\" box at the end\\n // dropallboxes: true, // points boxes next to answerlines instead of level with the question\\n instructions: [Instructions before exam columns.],\\n namebox: \\"left\\",\\n pointsplacement: \\"right\\",\\n answerlinelength: 4cm,\\n defaultpoints: 1,\\n)\\n
\\nquestions.typ
#import \\"@preview/examit:0.1.1\\": *\\n\\n#let questions = (\\n ( header: [Multiple Choice] ),\\n (\\n question: [What attributes #underline(\\"must\\") a *vector* have?],\\n points: 2,\\n choices: (\\n [position],\\n [magnitude],\\n [direction],\\n [x- and y-coordinates],\\n [height],\\n [width],\\n ),\\n horizontal: false,\\n sameline: false,\\n ),\\n (\\n question: [$bold(sin^(-1))$ returns an angle in which quadrants?],\\n choices: ([I],[II],[III],[IV],),\\n sameline: false,\\n points: 2,\\n ),\\n (\\n question: [A *scalar* is a vector with a\\\\ magnitude of *1*.],\\n tf: true,\\n points: 2,\\n ),\\n (\\n question: [\\n Write this polar equation in rectangular form: $r = frac(5 ,cos theta + sin theta )$\\n ],\\n points: 4,\\n bonus: true,\\n answerbox: 3cm,\\n ),\\n ( pagebreak: true ),\\n ( header: [Graphing]),\\n (\\n question: [\\n Simplify and graph the complex number\\\\ $5(cos 15 degree + i sin 15 degree) dot 10(cos 5 degree + i sin 5 degree)$.\\n ],\\n points: 3,\\n spacing: 2.5cm,\\n graph: \\"rect\\",\\n answerline: true,\\n ),\\n (\\n question: [$x^2(x^2+9)>6x^3$],\\n points: 2,\\n bonus: true,\\n numberline: 2.5in,\\n ),\\n (subheader: [A child is pulling a wagon with a force of 15 lb at an angle of 35° to the ground.\\n Gravity is pulling down on the wagon with a force of 12 lb.]),\\n (\\n question: [\\n What is the resulting force vector?\\n ],\\n points: 4,\\n spacing: 3cm,\\n label: \\"wagon\\"\\n ),\\n (\\n question: [\\n This question references \\\\#@wagon.\\n ],\\n points: 4,\\n ),\\n)\\n
\\nPackage for easy styling of links. See Docs for a detailed guide. Below is an example of the functionality that is added.\\nThe problem the package solves is that different link types cannot be styled seperatly, but are recognized as such. This package allows for easy styling of phone numbers, urls and mail addresses. It provides helper functions that return regex patterns for the most common use cases.
\\n#import \\"@previes/kinase:0.0.1\\"\\n\\n#show: make-link\\n\\n// Insert some rules\\n#update-link-style(key: l-mailto(), value: it => strong(it), )\\n#update-link-style(key: l-url(base: \\"typst\\\\.app\\"), value: it => emph(it))\\n#update-link-style(key: l-url(base: \\"google\\\\.com\\"), before: l-url(base: \\"typst\\\\.app\\"), value: it => highlight(it))\\n#update-link-style(key: l-url(base: \\"typst\\\\.app/docs\\"), value: it => strong(it), before: l-url(base: \\"typst\\\\.app\\"))\\n\\n#link(\\"mailto:john.smith@typst.org\\") \\\\\\n\\n#link(\\"https://www.typst.app/docs\\")\\n\\n#link(\\"typst.app\\")\\n\\n#link(\\"+49 2422424422\\")\\n
\\nParse a .env content.
\\n#import \\"@preview/tenv.typ:0.1.1\\": parse_dotenv\\n\\n#let env = parse_dotenv(read(\\".env\\"))\\n
\\nThe iconic-salmon-fa
package is designed to help you create your curriculum vitae (CV). It allows you to easily reference your social media profiles with the typical icon of the service plus a link to your profile.
\\nThe package name is a combination of the acronym SociAL Media icONs and the word iconic because all these icons have an iconic design (and iconic also contains the word icon).
text
)otfs
folder within the unzipped foldermkdir -p /usr/share/fonts/truetype/
install -m644 \'Font Awesome 6 Brands-Regular-400.otf\' /usr/share/fonts/truetype/
install -m644 \'Font Awesome 6 Free-Regular-400.otf\' /usr/share/fonts/truetype/
You can install the library using the typst packages:
\\n#import \\"@preview/iconic-salmon-fa:1.0.0\\": *\\n
\\nPut the iconic-salmon-fa.typ
file in your project directory and import it:
#import \\"iconic-salmon-fa.typ\\": *\\n
\\n// #import \\"@preview/iconic-salmon-fa:1.0.0\\": github-info, gitlab-info\\n#import \\"iconic-salmon-fa.typ\\": github-info, gitlab-info\\n\\nThis project was created by #github-info(\\"Bi0T1N\\"). You can also find me on #gitlab-info(\\"GitLab\\", rgb(\\"#811052\\"), url: \\"https://gitlab.com/Bi0T1N\\").\\n
\\nSee the examples.typ
file for a complete example. The generated PDF files are also available for preview.
Make sure that you have installed the required Font Awesome ligature-based font files.
\\nFeel free to open an issue or a pull request if you find any problems or have any suggestions.
\\nThis library is licensed under the MIT license. Feel free to use it in your project.
\\nProduct names, logos, brands and other trademarks referred to in this project are the property of their respective trademark holders.
\\nThese trademark holders are not affiliated with this Typst library, nor are the authors officially endorsed by them, nor do the authors claim ownership of these trademarks.
ascii-ipa
🔄 ASCII / IPA conversion for Typst
\\nThis package allows you to easily convert different ASCII representations of the International Phonetic Alphabet (IPA) to and from the IPA.\\nIt also offers some minor utilities to make phonetic transcriptions easier to use overall.\\nThe package is being maintained here.
\\nNote: This is an extended port of the ipa-translate
Rust crate by tirimid\'s conversion features into native Typst.\\nMost conversions are implemented according to this Wikipedia article which in turn relies of the official specifications of the respective ASCII representations.
The package supports multiple ASCII representations for the IPA with one function each:
\\n| Notation | Function name |\\n|----------|-----------------|\\n| Branner | #branner(...)
|\\n| Praat | #praat(...)
|\\n| SIL | #sil(...)
|\\n| X-SAMPA | #xsampa(...)
|
They all return the converted value as a string
and accept the set of same parameters:
| Parameter | Type | Positional / Named | Default | Description |\\n|-----------|-----------------------|--------------------|---------|------------------------------------------------------------------------------------------------------------|\\n| value
| string
| positional | | Main input to the function. Usually the transcription in the corresponsing ASCII-based notation. |\\n| reverse
| bool
| named | false
| Reverses the conversion. Pass Unicode IPA into value
to get the corresponsing ASCII-based notation back. |
All examples use the Swiss German word ⟨Chuchichäschtli⟩ [ˈχʊχːiˌχæʃːtlɪ] for the conversion.
\\n#import \\"@preview/ascii-ipa:2.0.0\\": *\\n\\n// returns \\"ˈχʊχːiˌχæʃːtlɪ\\"\\n#branner(\\"\'XUX:i,Xae)S:tlI\\")\\n\\n// returns \\"\'XUX:i,Xae)S:tlI\\"\\n#branner(\\"ˈχʊχːiˌχæʃːtlɪ\\", reverse: true)\\n\\n// returns \\"ˈχʊχːiˌχæʃːtlɪ\\"\\n#praat(\\"\\\\\\\\\'1\\\\\\\\cf\\\\\\\\hs\\\\\\\\cf\\\\\\\\:f\\\\\\\\\'2\\\\\\\\ae\\\\\\\\sh\\\\\\\\:ftl\\\\\\\\ic\\")\\n\\n// returns \\"\\\\\\\\\'1\\\\\\\\cf\\\\\\\\hs\\\\\\\\cf\\\\\\\\:f\\\\\\\\\'2\\\\\\\\ae\\\\\\\\sh\\\\\\\\:ftl\\\\\\\\ic\\"\\n#praat(\\"ˈχʊχːiˌχæʃːtlɪ\\", reverse: true)\\n\\n// returns \\"ˈχʊχːiˌχæʃːtlɪ\\"\\n#sil(\\"}x=u<x=:i}}x=a<s=:tli=\\")\\n\\n// returns \\"}x=u<x=:i}}x=a<s=:tli=\\"\\n#sil(\\"ˈχʊχːiˌχæʃːtlɪ\\", reverse: true)\\n\\n// returns \\"ˈχʊχːiˌχæʃːtlɪ\\"\\n#xsampa(\\"\\\\\\"XUX:i%X{S:tlI\\")\\n\\n// returns \\"\\\\\\"XUX:i%X{S:tlI\\"\\n#xsampa(\\"ˈχʊχːiˌχæʃːtlɪ\\", reverse: true)\\n
\\nraw
You can also use raw
for the conversion.\\nThis is useful if the notation uses a lot of backslashes.
#import \\"@preview/ascii-ipa:2.0.0\\": praat\\n\\n// regular string\\n#praat(\\"\\\\\\\\\'1\\\\\\\\cf\\\\\\\\hs\\\\\\\\cf\\\\\\\\:f\\\\\\\\\'2\\\\\\\\ae\\\\\\\\sh\\\\\\\\:ftl\\\\\\\\ic\\")\\n\\n// raw\\n#praat(`\\\\\'1\\\\cf\\\\hs\\\\cf\\\\:f\\\\\'2\\\\ae\\\\sh\\\\:ftl\\\\ic`)\\n
\\nNote: raw
will not play nicely with notations that use `
a lot.
You can easily mark your notation text as different types of brackets or braces.
\\n#import \\"@preview/ascii-ipa:2.0.0\\": *\\n\\n#phonetic(\\"prʲɪˈvʲet\\") // [prʲɪˈvʲet]\\n#phnt(\\"prʲɪˈvʲet\\") // [prʲɪˈvʲet]\\n\\n#precise(\\"prʲɪˈvʲet\\") // ⟦prʲɪˈvʲet⟧\\n#prec(\\"prʲɪˈvʲet\\") // ⟦prʲɪˈvʲet⟧\\n\\n#phonemic(\\"prɪvet\\") // /prɪvet/\\n#phnm(\\"prɪvet\\") // /prɪvet/\\n\\n#morphophonemic(\\"prɪvet\\") // ⫽prɪvet⫽\\n#mphnm(\\"prɪvet\\") // ⫽prɪvet⫽\\n\\n#indistinguishable(\\"prʲɪˈvʲet\\") // (prʲɪˈvʲet)\\n#idst(\\"prʲɪˈvʲet\\") // (prʲɪˈvʲet)\\n\\n#obscured(\\"prʲɪˈvʲet\\") // ⸨prʲɪˈvʲet⸩\\n#obsc(\\"prʲɪˈvʲet\\") // ⸨prʲɪˈvʲet⸩\\n\\n#orthographic(\\"привет\\") // ⟨привет⟩\\n#orth(\\"привет\\") // ⟨привет⟩\\n\\n#transliterated(\\"privyet\\") // ⟪privyet⟫\\n#trlt(\\"privyet\\") // ⟪privyet⟫\\n\\n#prosodic(\\"prʲɪˈvʲet\\") // {prʲɪˈvʲet}\\n#prsd(\\"prʲɪˈvʲet\\") // {prʲɪˈvʲet}\\n
\\n","description":"🔄 ASCII / IPA conversion for Typst This package allows you to easily convert different ASCII representations of the International Phonetic Alphabet (IPA) to and from the IPA. It also offers some minor utilities to make phonetic transcriptions easier to use overall. The package…","guid":"https://typst.app/universe/package/ascii-ipa","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-14T08:21:13.088Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"k-mapper (1.1.0) | A package to add Karnaugh maps into Typst projects.","url":"https://typst.app/universe/package/k-mapper","content":"k-mapper
for Typst (1.1.0)📖 See the k-mapper
Manual here! The Manual features much more documentation, and is typeset using Typst.
This is a package for adding Karnaugh maps into your Typst projects.
\\nSee the changelog for the package here.
\\nSimply import k-mapper
using the Typst package manager to begin using k-mapper
within your Typst documents.
#import \\"@preview/k-mapper:1.1.0\\": *\\n
\\n #karnaugh(\\n 16,\\n x-label: $C D$,\\n y-label: $A B$,\\n manual-terms: (\\n 0, 1, 2, 3, 4, 5, 6, 7, 8, \\n 9, 10, 11, 12, 13, 14, 15\\n ),\\n implicants: ((5, 7), (5, 13), (15, 15)),\\n vertical-implicants: ((1, 11), ),\\n horizontal-implicants: ((4, 14), ),\\n corner-implicants: true,\\n )\\n
\\nFor more detailed documentation and examples, including function parameters, see the Manual PDF and Typst file in the Github repo.
\\n","description":"📖 See the k-mapper Manual here! The Manual features much more documentation, and is typeset using Typst. This is a package for adding Karnaugh maps into your Typst projects.\\n\\nSee the changelog for the package here.\\n\\nFeatures\\n2-variable (2 by 2) Karnaugh maps\\n3-variable (2 by 4…","guid":"https://typst.app/universe/package/k-mapper","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-14T08:20:37.309Z","media":[{"url":"https://raw.githubusercontent.com/derekchai/k-mapper/blob/005cb0a839499d0dfa90ee48d2128d41e582d755/readme-example.png","type":"photo"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"structogrammer (0.1.1) | Draw Nassi-Shneiderman diagrams (or structograms)","url":"https://typst.app/universe/package/structogrammer","content":"Draw Nassi-Shneiderman diagrams, also called structograms, in Typst.
\\nImport with:
\\n#import \\"@preview/structogrammer:0.1.0\\": structogram\\n
\\nYou can then draw structograms, like so:
\\n#structogram(\\n width: 30em,\\n title: \\"merge_sort(list)\\",\\n (\\n (If: \\"list empty\\", Then: (Break: \\"exit (return list)\\")),\\n \\"left = []\\",\\n \\"right = []\\",\\n (For: \\"element with index i\\", In: \\"list\\", Do: (\\n (If: \\"i < list.length / 2\\", Then: (\\n \\"left.add(element)\\"\\n ), Else: (\\n \\"right.add(element)\\"\\n ))\\n )),\\n \\"left = merge_sort(left)\\",\\n \\"right = merge_sort(right)\\",\\n (Break: \\"return with merge(left, right)\\")\\n )\\n)\\n
\\nwhich yields:
\\n
If text.lang
is set to another language, this package will try to match inserted text to it. Currently, only \\"en\\"
and \\"de\\"
are supported
structogram()
takes the following named arguments:
columns
: If you already allocated wide and narrow columns, to-elements
\\ncan use them. Useful for sub-specs, as you\'d usually generate\\nallocations first and then do another recursive pass to fill them. auto
does exactly this on the highest recursion level.stroke
: The stroke to use between cells, or for control blocks.\\nNote: to avoid duplicate strokes, every cell only adds strokes to\\nits top and left side. Put the resulting cells in a container with\\nbottom and right strokes for a finished diagram. See structogram()
. 0.5pt + black
inset
: How much to pad each cell. 0.5em
segment-height
: How high each row should be. 2em
narrow-width
: The width that narrow columns will be. Needed for diagonals in\\nconditional blocks. A spec
(the positional argument to structogram()
) can be one of the following:
none
or an emtpy array
()
:\\nAn empty cell,\\ntaking up at least a narrow columnstring
or content
:\\nA cell containing that string or content,\\ntaking up at least a wide columndictionary
:\\nControl block (see below)array
of specs:\\nThe cells that each element produced,\\nstacked on top of each other. Wide columns\\nare aligned to wide columns of other element\\nspecs and narrow columns consumed as needed.Specs can contain the following control blocks, as dictionaries:
\\nIf
/Then
/Else
:A conditional with the following keys:
\\nIf
: The condition on which to branchThen
: A diagram spec for the \\"yes\\"-branchElse
: A diagram spec for the \\"no\\"-branchThen
and Else
are both optional, but at least one must be present
Examples:
(If: \\"debug mode\\", Then: (\\"print debug message\\"))
(If: \\"x > 5\\", Then: (\\"x = x - 1\\", \\"print x\\"), Else: \\"print x\\")
Columns: Takes up columns according to its contents next to one another,\\ninserting narrow columns for empty branches
\\nFor
/Do
, For
/To
/Do
, For
/In
/Do
, While
/Do
, Do
/While
:A loop, with the loop control either at the top or bottom.
\\nFor
/Do
formats the control as \\"For $For\\",For
/To
/Do
as \\"For $For to $To\\",For
/In
/Do
as \\"For each $For in $In\\",While
/Do
and Do
/While
as \\"While $While\\".Order of specified keys matters.
\\nExamples:
(While: \\"true\\", Do: \\"print \\\\\\"endless loop\\\\\\"\\")
(Do: \\"print \\\\\\"endless loop\\\\\\"\\", While: \\"true\\")
(For: \\"item\\", In: \\"Container\\", Do: \\"print item.name\\")
Columns: Inserts a narrow column left to its content.
\\nCall
)A block indicating that a subroutine is executed here.\\nOnly accepts the key Call
, which is the string name
Example:
(Call: \\"func()\\")
Columns: One wide column
\\nBreak
)A block indicating that a subroutine is executed here.\\nOnly accepts the key Break
, which is the target to break to
Examples:
(Break: \\"\\")
(Break: \\"to enclosing loop\\")
Columns: One wide column
\\n","description":"Draw Nassi-Shneiderman diagrams, also called structograms, in Typst. Basic Usage\\n\\nImport with:\\n\\n#import \\"@preview/structogrammer:0.1.0\\": structogram\\n\\n\\nYou can then draw structograms, like so:\\n\\n#structogram(\\n width: 30em,\\n title: \\"merge_sort(list)\\",\\n (\\n (If: \\"list empty\\", Then:…","guid":"https://typst.app/universe/package/structogrammer","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-14T08:05:23.385Z","media":[{"url":"https://raw.githubusercontent.com/genericusername3/structogrammer/master/examples/merge-sort.svg","type":"photo","width":704,"height":685},{"url":"https://raw.githubusercontent.com/genericusername3/structogrammer/master/examples/if-then.svg","type":"photo","width":291,"height":131},{"url":"https://raw.githubusercontent.com/genericusername3/structogrammer/master/examples/if-then-else.svg","type":"photo","width":291,"height":188},{"url":"https://raw.githubusercontent.com/genericusername3/structogrammer/master/examples/while-do.svg","type":"photo","width":291,"height":131},{"url":"https://raw.githubusercontent.com/genericusername3/structogrammer/master/examples/do-while.svg","type":"photo","width":291,"height":131},{"url":"https://raw.githubusercontent.com/genericusername3/structogrammer/master/examples/for-in.svg","type":"photo","width":291,"height":131},{"url":"https://raw.githubusercontent.com/genericusername3/structogrammer/master/examples/call.svg","type":"photo","width":291,"height":73},{"url":"https://raw.githubusercontent.com/genericusername3/structogrammer/master/examples/break.svg","type":"photo","width":291,"height":73},{"url":"https://raw.githubusercontent.com/genericusername3/structogrammer/master/examples/break-to.svg","type":"photo","width":291,"height":73}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"tidy (0.3.0) | Documentation generator for Typst code in Typst.","url":"https://typst.app/universe/package/tidy","content":"Keep it tidy.
\\n\\ntidy is a package that generates documentation directly in Typst for your Typst modules. It parses docstring comments similar to javadoc and co. and can be used to easily build a beautiful reference section for the parsed module. Within the docstring you may use (almost) any Typst syntax − so markup, equations and even figures are no problem!
\\nFeatures:
\\nThe guide fully describes the usage of this module and defines the format for the docstrings.
\\nUsing tidy
is as simple as writing some docstrings and calling:
#import \\"@preview/tidy:0.3.0\\"\\n\\n#let docs = tidy.parse-module(read(\\"my-module.typ\\"))\\n#tidy.show-module(docs, style: tidy.styles.default)\\n
\\nThe available predefined styles are currenty tidy.styles.default
and tidy.styles.minimal
. Custom styles can be added by hand (take a look at the guide).
A full example on how to use this module for your own package (maybe even consisting of multiple files) can be found at examples.
\\n/// This function computes the cardinal sine, $sinc(x)=sin(x)/x$. \\n///\\n/// #example(`#sinc(0)`, mode: \\"markup\\")\\n///\\n/// - x (int, float): The argument for the cardinal sine function. \\n/// -> float\\n#let sinc(x) = if x == 0 {1} else {calc.sin(x) / x}\\n
\\ntidy turns this into:
\\nThe code in the docstrings is evaluated via eval()
. In order to access user-defined functions and images, you can make use of the scope
argument of tidy.parse-module()
:
#{\\n import \\"my-module.typ\\"\\n let module = tidy.parse-module(read(\\"my-module.typ\\"))\\n let an-image = image(\\"img.png\\")\\n tidy.show-module(\\n module,\\n style: tidy.styles.default,\\n scope: (my-module: my-module, img: an-image)\\n )\\n}\\n
\\nThe docstrings in my-module.typ
may now access the image with #img
and can call any function or variable from my-module
in the style of #my-module.my-function()
. This makes rendering examples right in the docstrings as easy as a breeze!
With tidy, you can add a help command to you package that allows users to obtain the documentation of a specific definition or parameter right in the document. This is similar to CLI-style help commands. If you have already written docstrings for your package, it is quite low-effort to add this feature. Once set up, the end-user can use it like this:
\\n// happily coding, but how do I use this one complex function again?\\n\\n#mypackage.help(\\"func\\")\\n#mypackage.help(\\"func(param1)\\") // print only parameter description of param1\\n
\\nThis will print the documentation of func
directly into the document — no need to look it up in a manual. Read up in the guide for setup instructions.
It is possible to add simple docstring tests — assertions that will be run when the documentation is generated. This is useful if you want to keep small tests and documentation in one place.
\\n/// #test(\\n/// `num.my-square(2) == 4`,\\n/// `num.my-square(4) == 16`,\\n/// )\\n#let my-square(n) = n * n\\n
\\nWith the short-hand syntax, a unfulfilled assertion will even print the line number of the failed test:
\\n/// >>> my-square(2) == 4\\n/// >>> my-square(4) == 16\\n#let my-square(n) = n * n\\n
\\nA few test assertion functions are available to improve readability, simplicity, and error messages. Currently, these are eq(a, b)
for equality tests, ne(a, b)
for inequality tests and approx(a, b, eps: 1e-10)
for floating point comparisons. These assertion helper functions are always available within docstring tests (with both test()
and >>>
syntax).
preamble
option for examples (e.g., to add import
statements).show-module
: omit-private-definitions
, omit-private-parameters
, enable-cross-references
, local-names
(for configuring language-specific strings).show-example()
as standalone.scale-preview
is not auto
.show-outline
raw(lang: none)
for types and function names.color
and gradient
.show-reference()
.default
theme).@@
syntax could omit the function parentheses. Now this is not possible anymore, since such references refer to variables now.show-outline()
, show-parameter-list
, and show-type()
now take style-args
arguments as well.Initial Release.
\\n","description":"Keep it tidy. tidy is a package that generates documentation directly in Typst for your Typst modules. It parses docstring comments similar to javadoc and co. and can be used to easily build a beautiful reference section for the parsed module. Within the docstring you may…","guid":"https://typst.app/universe/package/tidy","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-14T08:02:55.547Z","media":[{"url":"https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FMc-Zen%2Ftidy%2Fmain%2Ftypst.toml&query=%24.package.version&prefix=v&logo=typst&label=package&color=239DAD","type":"photo","width":117,"height":20},{"url":"https://img.shields.io/badge/license-MIT-blue","type":"photo","width":78,"height":20},{"url":"https://img.shields.io/badge/manual-.pdf-purple","type":"photo","width":82,"height":20},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/tidy/0.3.0/docs/images/sincx-docs.svg","type":"photo","width":708,"height":424}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"bamdone-aiaa (0.1.1) | An American Institute of Aeronautics and Astronautics (AIAA) template for conferences.","url":"https://typst.app/universe/package/bamdone-aiaa","content":"This is a Typst template for a one-column paper from the proceedings of the American Institute of Aeronautics and Astronautics. The paper is tightly spaced, fits a lot of content and comes preconfigured for numeric citations from\\nBibLaTeX or Hayagriva files.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for bamdone-aiaa
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/bamdone-aiaa\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the aiaa
function with the following named arguments:
title
: The paper\'s title as content.authors-and-affiliations
: An array of author dictionaries and affiliation dictionaries.\\nAuthor dictionaries must have a name
key and can have the keys job
, department
, aiaa
is optional. Affiliation dictionaries must have the keys institution
,city
,state
,zip
, and country
.abstract
: The content of a brief summary of the paper or none
. Appears at the top of the first column in boldface. Shall be content
.paper-size
: Defaults to us-letter
. Specify a paper size string to change the page format.bibliography
: The result of a call to the bibliography
function or none
.\\nSpecifying this will configure numeric, AIAA-style citations.The function also accepts a single, positional argument for the body of the\\npaper.
\\nThe template will initialize your package with a sample call to the aiaa
\\nfunction in a show rule. If you want to change an existing project to use this\\ntemplate, you can add a show rule like this at the top of your file:
#import \\"@preview/bamdone-aiaa:0.1.0\\": aiaa\\n\\n#show: aiaa.with(\\n title: [A typesetting system to untangle the scientific writing process],\\n abstract: [\\n These instructions give you guidelines for preparing papers for AIAA Technical Papers. Use this document as a template if you are using Typst. Otherwise, use this document as an instruction set. Define all symbols used in the abstract. Do not cite references in the abstract. The footnote on the first page should list the Job Title and AIAA Member Grade for each author, if known. Authors do not have to be AIAA members.\\n ],\\n authors: (\\n (\\n name:\\"First A. Author\\",\\n job:\\"Insert Job Title\\",\\n department:\\"Department Name\\",\\n aiaa:\\"and AIAA Member Grade (if any) for first author\\"\\n ),\\n (\\n institution:\\"Business or Academic Affiliation\'s Full Name 1\\",\\n city:\\"City\\",\\n state:\\"State\\",\\n zip:\\"Zip Code\\",\\n country:\\"Country\\"\\n ),\\n ),\\n bibliography: bibliography(\\"refs.bib\\"),\\n)\\n\\n// Your content goes below.\\n
\\n","description":"This is a Typst template for a one-column paper from the proceedings of the American Institute of Aeronautics and Astronautics. The paper is tightly spaced, fits a lot of content and comes preconfigured for numeric citations from BibLaTeX or Hayagriva files. Usage\\n\\nYou can use…","guid":"https://typst.app/universe/package/bamdone-aiaa","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-14T07:53:48.855Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"chuli-cv (0.1.0) | Minimalistic and modern CV and cover letter templates.","url":"https://typst.app/universe/package/chuli-cv","content":"These are a minimalistic and modern CV and cover letter written in Typst.
\\ntypst init @preview/chuli-cv:0.1.0
to start your own CV.Simple cheatsheet template for Typst that allows you to\\nsnap a quick picture of essential information and cram it into a useful\\ncheatsheet format.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for cram-snap
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/cram-snap\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the cram-snap
function with the following named\\narguments:
title
: Title of the documentsubtitle
: Subtitle of the documenticon
: Image that appears next to the titlecolumn-number
: Number of columnsThe theader
function is a wrapper around the table.header
function that\\ncreates a header and takes colspan
as argument to span the header across\\nmultiple table columns (by default it spans across two)
If you want to change an existing project to use this template, you can add a\\nshow rule like this at the top of your file:
\\n#import \\"@preview/cram-snap:0.2.1\\": *\\n\\n#set page(paper: \\"a4\\", flipped: true, margin: 1cm)\\n#set text(font: \\"Arial\\", size: 11pt)\\n\\n#show: cram-snap.with(\\n title: [Cheatsheet],\\n subtitle: [Cheatsheet for an amazing program],\\n icon: image(\\"icon.png\\"),\\n column-number: 3,\\n)\\n\\n// Use it if you want different table columns (the default are: (2fr, 3fr))\\n#set table(columns: (2fr, 3fr, 3fr))\\n\\n#table(\\n theader(colspan: 3)[Great heading that is really looooong],\\n [Closing the program], [Type `:q`], [You can also type `QQ`]\\n)\\n
\\n","description":"Simple cheatsheet template for Typst that allows you to snap a quick picture of essential information and cram it into a useful cheatsheet format. Usage\\n\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the dashboard and searching for cram-snap.…","guid":"https://typst.app/universe/package/cram-snap","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-13T12:42:55.891Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"mitex (0.2.4) | LaTeX support for Typst, powered by Rust and WASM.","url":"https://typst.app/universe/package/mitex","content":"LaTeX support for Typst, powered by Rust and WASM.
\\nMiTeX processes LaTeX code into an abstract syntax tree (AST). Then it transforms the AST into Typst code and evaluates code into Typst content by eval
function.
MiTeX has been proved to be practical on a large project. It has already correctly converted 32.5k equations from OI Wiki. Compared to texmath, MiTeX has a better display effect and performance in that wiki project. It is also more easy to use, since importing MiTeX to Typst is just one line of code, while texmath is an external program.
\\nIn addition, MiTeX is not only SMALL but also FAST! MiTeX has a size of just about 185 KB, comparing that texmath has a size of 17 MB. A not strict but intuitive comparison is shown below. To convert 32.5k equations from OI Wiki, texmath takes about 109s, while MiTeX WASM takes only 2.28s and MiTeX x86 takes merely 0.085s.
\\nThanks to @Myriad-Dreamin, he completed the most complex development work: developing the parser for generating AST.
\\nmitex-convert
to convert LaTeX code into Typst code in string.mi
to render an inline LaTeX equation in Typst.mitex(numbering: none, supplement: auto, ..)
or mimath
to render a block LaTeX equation in Typst.mitext
to render a LaTeX text in Typst.PS: #set math.equation(numbering: \\"(1)\\")
is also valid for MiTeX.
Following is a simple example of using MiTeX in Typst:
\\n#import \\"@preview/mitex:0.2.4\\": *\\n\\n#assert.eq(mitex-convert(\\"\\\\alpha x\\"), \\"alpha x \\")\\n\\nWrite inline equations like #mi(\\"x\\") or #mi[y].\\n\\nAlso block equations (this case is from #text(blue.lighten(20%), link(\\"https://katex.org/\\")[katex.org])):\\n\\n#mitex(`\\n \\\\newcommand{\\\\f}[2]{#1f(#2)}\\n \\\\f\\\\relax{x} = \\\\int_{-\\\\infty}^\\\\infty\\n \\\\f\\\\hat\\\\xi\\\\,e^{2 \\\\pi i \\\\xi x}\\n \\\\,d\\\\xi\\n`)\\n\\nWe also support text mode (in development):\\n\\n#mitext(`\\n \\\\iftypst\\n #set math.equation(numbering: \\"(1)\\", supplement: \\"equation\\")\\n \\\\fi\\n\\n \\\\section{Title}\\n\\n A \\\\textbf{strong} text, a \\\\emph{emph} text and inline equation $x + y$.\\n\\n Also block \\\\eqref{eq:pythagoras}.\\n\\n \\\\begin{equation}\\n a^2 + b^2 = c^2 \\\\label{eq:pythagoras}\\n \\\\end{equation}\\n`)\\n
\\nInstall latest nightly version by cargo install --git https://github.com/mitex-rs/mitex mitex-cli
.
mitex compile main.tex\\n# or (same as above)\\nmitex compile main.tex mitex.typ\\n
\\nWe can convert LaTeX equations to Typst equations in web by wasm. https://mitex-rs.github.io/mitex/
\\nWe made a proof of concept online tex editor to show our conversion speed in text mode. The PoC loads files from a git repository and then runs typst compile in browser. As you see, each keystroking get response in preview quickly.
\\nhttps://mitex-rs.github.io/mitex/tools/underleaf.html
\\nhttps://github.com/mitex-rs/mitex/assets/34951714/0ce77a2c-0a7d-445f-b26d-e139f3038f83
\\n\\\\newcommand{\\\\mysym}{\\\\alpha}
.\\\\color{red} text
, \\\\textcolor{red}{text}
).\\\\section
, \\\\textbf
, \\\\emph
.\\\\ref
, \\\\eqref
and \\\\label
.itemize
and enumerate
environments.let myop(it) = op(upright(it))
and then use it by \\\\myop{it}
.To achieve the latter two goals, we need a well-structured architecture for the text mode, along with intricate work. Currently, we don\'t have very clear ideas yet. If you are willing to contribute by discussing in the issues or even submitting pull requests, your contribution is highly welcome.
\\nMiTeX has different objectives compared to texmath (a.k.a. pandoc):
\\nFor example, MiTeX transforms \\\\frac{1}{2}_3
into frac(1, 2)_3
, while texmath converts it into 1 / 2_3
. The latter\'s display is not entirely correct, whereas the former ensures consistency in display.
Another example is that MiTeX transforms (\\\\frac{1}{2})
into \\\\(frac(1, 2)\\\\)
instead of (frac(1, 2))
, avoiding the use of automatic Left/Right to achieve consistency with LaTeX rendering.
Certainly, the greatest advantage is that you can directly write LaTeX content in Typst without the need for manual conversion!
\\nIf you find missing commands or bugs of MiTeX, please feel free to submit an issue here.
\\nCurrently, MiTeX maintains following three parts of code:
\\nFor a translation process, for example, we have:
\\n\\\\frac{1}{2}\\n\\n===[parser]===> AST ===[converter]===>\\n\\n#eval(\\"$frac(1, 2)$\\", scope: (frac: (num, den) => $(num)/(den)$))\\n
\\nYou can use the #mitex-convert()
function to get the Typst Code generated from LaTeX Code.
Even if you don\'t know Rust at all, you can still add missing TeX commands to MiTeX by modifying specification files, since they are written in typst! You can open an issue to acquire the commands you want to add, or you can edit the files and submit a pull request.
\\nIn the future, we will provide the ability to customize TeX commands, which will make it easier for you to use the commands you create for yourself.
\\nSee CONTRIBUTING.md.
\\n","description":"LaTeX support for Typst, powered by Rust and WASM. MiTeX processes LaTeX code into an abstract syntax tree (AST). Then it transforms the AST into Typst code and evaluates code into Typst content by eval function.\\n\\nMiTeX has been proved to be practical on a large project. It has…","guid":"https://typst.app/universe/package/mitex","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-13T09:23:28.154Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/mitex/0.2.4/examples/example.png","type":"photo","width":1000,"height":404}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"modern-nju-thesis (0.3.4) | 南京大学学位论文模板。Modern Nanjing University Thesis.","url":"https://typst.app/universe/package/modern-nju-thesis","content":"南京大学毕业论文(设计)的 Typst 模板,能够简洁、快速、持续生成 PDF 格式的毕业论文。Typst Universe
\\nTypst 非官方中文交流群:793548390
\\n南京大学 Typst 交流群:943622984
\\nTypst 是可用于出版的可编程标记语言,拥有变量、函数与包管理等现代编程语言的特性,注重于科学写作 (science writing),定位与 LaTeX 相似。可以阅读我的 一篇知乎文章 进一步了解 Typst 的优势。
\\n[标记模式]
、{脚本模式}
与 $数学模式$
等多种模式的作用域,并且它们可以不限深度地、交互地嵌套。并且通过 包管理,你不再需要像 TexLive 一样在本地安装一大堆并不必要的宏包,而是 按需自动从云端下载。可以参考我参与搭建和翻译的 Typst 中文文档网站 迅速入门。
\\n快速浏览效果: 查看 thesis.pdf,样例论文源码:查看 thesis.typ
\\n你只需要修改 thesis.typ
文件即可,基本可以满足你的所有需求。
如果你认为不能满足你的需求,可以先查阅后面的 Q&A 部分。
\\n模板已经上传到了 Typst Universe,使用起来十分简单,理论上只需要通过
\\n#import \\"@preview/modern-nju-thesis:0.3.4\\": documentclass\\n
\\n导入即可。
\\nTypst 提供了官方的 Web App,支持像 Overleaf 一样在线编辑,这是一个 例子。
\\n实际上,我们只需要在 Web App 中的 Start from template
里选择 modern-nju-thesis
,即可在线创建模板并使用。
但是 Web App 并没有安装本地 Windows 或 MacOS 所拥有的字体,所以字体上可能存在差异,所以推荐本地编辑!
\\n你需要手动上传 fonts 目录下的字体文件到项目中,否则会导致字体显示错误!
\\nPS: 虽然与 Overleaf 看起来相似,但是它们底层原理并不相同。Overleaf 是在后台服务器运行了一个 LaTeX 编译器,本质上是计算密集型的服务;而 Typst 只需要在浏览器端使用 WASM 技术执行,本质上是 IO 密集型的服务,所以对服务器压力很小(只需要负责文件的云存储与协作同步功能)。
\\nCtrl + B
进行加粗等便捷的快捷键。Ctrl + Shift + P
打开命令界面,输入 Typst: Show available Typst templates (gallery) for picking up a template
打开 Tinymist 提供的 Template Gallery,然后从里面找到 modern-nju-thesis
,点击 ❤
按钮进行收藏,以及点击 +
号,就可以创建对应的论文模板了。thesis.typ
文件,并按下 Ctrl + K V
进行实时编辑和预览。documentclass
的全局信息配置#show math.equation: set text(font: \\"Fira Math\\")
更改1.1
格式进行编号(1.1)
格式进行编号还实现了本科生和研究生的开题报告,只需要预览和编辑 others
目录下的文件即可。
可以。
\\n如果你不关注模板的具体实现原理,你可以用 Markdown Like 的语法进行编写,只需要按照模板的结构编写即可。
\\n同样可以。
\\n如果仅仅是当成是入门一款类似于 Markdown 的语言,相信使用该模板的体验会比使用 Word 编写更好。
\\n这是因为本地没有对应的字体,这种情况经常发生在 MacOS 的「楷体」显示上。
\\n你应该安装本目录下的 fonts
里的所有字体,里面包含了可以免费商用的「方正楷体」和「方正仿宋」,然后再重新渲染测试即可。
你可以使用 #fonts-display-page()
显示一个字体渲染测试页面,查看对应的字体是否显示成功。
如果还是不能成功,你可以按照模板里的说明自行配置字体,例如
\\n#let (...) = documentclass(\\n fonts: (楷体: (\\"Times New Roman\\", \\"FZKai-Z03S\\")),\\n)\\n
\\n先是填写英文字体,然后再填写你需要的「楷体」中文字体。
\\n字体名称可以通过 typst fonts
命令查询。
如果找不到你所需要的字体,可能是因为 该字体变体(Variants)数量过少,导致 Typst 无法识别到该中文字体。
\\n一般而言,仅仅进行简单的编写,不关注布局的话,你可以打开模板就开始写了。
\\n如果你想进一步学习 Typst 的语法,例如如何排篇布局,如何设置页脚页眉等,一般只需要几个小时就能学会。
\\n如果你还想学习 Typst 的「元信息」部分,进而能够编写自己的模板,一般而言需要几天的时间阅读文档,以及他人编写的模板代码。
\\n如果你有 Python 或 JavaScript 等脚本语言的编写经验,了解过函数式编程、宏、样式、组件化开发等概念,入门速度会快很多。
\\n可以参考 面向 LaTeX 用户的 Typst 入门指南。
\\n可以查看 Typst Universe。
\\n因为 Typst 语法足够简洁、编译速度足够快、并且 拥有光标点击处双向链接功能。
\\n语法简洁的好处是,即使把所有内容都写在同一个文件,你也可以很简单地分辨出各个部分的内容。
\\n编译速度足够快的好处是,你不再需要像 LaTeX 一样,将内容分散在几个文件,并通过注释的方式提高编译速度。
\\n光标点击处双向链接功能,使得你可以直接拖动预览窗口到你想要的位置,然后用鼠标点击即可到达对应源码所在位置。
\\n还有一个好处是,单个源文件便于同步和分享。
\\n即使你还是想要分成几个章节,也是可以的,Typst 支持你使用 #import
和 #include
语法将其他文件的内容导入或置入。你可以新建文件夹 chapters
,然后将各个章节的源文件放进去,然后通过 #include
置入 thesis.typ
里。
理论上你并不需要更改 nju-thesis
目录下的任何文件,无论是样式还是其他的配置,你都可以在 thesis.typ
文件内修改函数参数实现更改。具体的更改方式可以阅读 nju-thesis
目录下的文件的函数参数。
例如,想要更改页面边距为 50pt
,只需要将
#show: doc\\n
\\n改为
\\n#show: doc.with(margin: (x: 50pt))\\n
\\n即可。
\\n后续我也会编写一个更详细的文档,可能会考虑使用 tidy 来编写。
\\n如果你阅读了那些函数的参数,仍然不知道如何修改得到你需要的样式,欢迎提出 Issue,只要描述清楚问题即可。
\\n或者也欢迎加群讨论:943622984
\\n其他现存的 Typst 中文论文模板大多都是在 2023 年 7 月份之前(Typst Verison 0.6 之前)开发的,当时 Typst 还不不够成熟,甚至连 包管理 功能都还没有,因此当时的 Typst 中文论文模板的开发者基本都是自己从头写了一遍需要的功能/函数,因此造成了 代码耦合度高、意大利面条式代码、重复造轮子 与 难以自定义样式 等问题。
\\n该模板是在 2023 年 10 ~ 11 月份(Typst Verison 0.9 时)开发的,此时 Typst 语法基本稳定,并且提供了 包管理 功能,因此能够减少很多不必要的代码。
\\n并且我对模板的文件架构进行了解耦,主要分为了 utils
、pages
和 layouts
三个目录,这三个目录可以看后文的开发者指南,并且使用 闭包 特性实现了类似不可变全局变量的全局配置能力,即模板中的 documentclass
函数类。
我在开发的过程中已经对模板的各个模板进行了解耦,理论上你只需要在 pages
目录中加入你需要的页面,然后更改少许、或者不需要更改其他目录的代码。
具体目录职责划分可以看下面的开发者指南。
\\nthesis.typ
文件: 你的论文源文件,可以随意更改这个文件的名字,甚至你可以将这个文件在同级目录下复制多份,维持多个版本。ref.bib
文件: 用于放置参考文献。images
目录: 用于放置图片。utils
目录: 包含了模板使用到的各种自定义辅助函数,存放没有外部依赖,且 不会渲染出页面的函数。pages
目录: 包含了模板用到的各个 独立页面,例如封面页、声明页、摘要等,即 会渲染出不影响其他页面的独立页面的函数。layouts
目录: 布局目录,存放着用于排篇布局的、应用于 show
指令的、横跨多个页面的函数,例如为了给页脚进行罗马数字编码的前言 preface
函数。\\ndoc
文稿、preface
前言、mainmatter
正文与 appendix
附录/后记。lib.typ
:\\ndocumentclass
函数类进行全局信息配置,然后暴露出拥有了全局配置的、具体的 layouts
和 pages
内部函数。This project is licensed under the MIT License.
\\n","description":"南京大学毕业论文(设计)的 Typst 模板,能够简洁、快速、持续生成 PDF 格式的毕业论文。Typst Universe Typst 非官方中文交流群:793548390\\n\\n南京大学 Typst 交流群:943622984\\n\\n劣势\\nTypst 是一门新生的排版标记语言,还做不到像 Word 或 LaTeX 一样成熟稳定。\\n该模板并非官方模板,而是民间模板,存在不被认可的风险。\\n优势\\n\\nTypst 是可用于出版的可编程标记语言,拥有变量、函数与包管理等现代编程语言的特性,注重于科学写作 (science writing),定位与 LaTeX 相似…","guid":"https://typst.app/universe/package/modern-nju-thesis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-13T08:38:33.857Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/modern-nju-thesis/0.3.4/imgs/editor.png","type":"photo","width":3840,"height":2062},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/modern-nju-thesis/0.3.4/imgs/template.png","type":"photo","width":3840,"height":1922},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/modern-nju-thesis/0.3.4/imgs/webapp.png","type":"photo","width":3840,"height":1922},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/modern-nju-thesis/0.3.4/imgs/gallery.png","type":"photo","width":1682,"height":291},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/modern-nju-thesis/0.3.4/imgs/proposal.png","type":"photo","width":1920,"height":1020}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"solving-physics (0.1.0) | A package to formulate the solution to a physical problem","url":"https://typst.app/universe/package/solving-physics","content":"The easiest method is to import solving-physics: task
from the @preview
package:
#import \\"@preview/solving-physics:0.1.0\\": *\\n
\\n#task(\\n given: [\\n $mu = 0.4$ \\\\\\n $g = 10$ \\\\\\n $m = 20$\\n ],\\n find: [\\n $F$ --- ?\\n ],\\n fig: image(\\"./example.png\\", width: 5cm)\\n)[\\n #lorem(100)\\n]\\n
\\n#task(\\n given: [\\n $mu = 0.4$ \\\\\\n $g = 10$ \\\\\\n $m = 20$\\n ],\\n find: [\\n $F$ --- ?\\n ],\\n stroke: \\"full\\"\\n)[]\\n
\\n#task(\\n given: [\\n $mu = 0.4$ \\\\\\n $g = 10$ \\\\\\n $m = 20$\\n ],\\n find: [\\n $F$ --- ?\\n ],\\n stroke: \\"find\\"\\n)[]\\n
\\n#task(\\n given: [\\n $mu = 0.4$ \\\\\\n $g = 10$ \\\\\\n $m = 20$\\n ],\\n find: [\\n $F$ --- ?\\n ],\\n stroke: none\\n)[]\\n
\\nIf you have so large given you may use given-width
:
#task(\\n given: [\\n $mu = 0.4$ \\\\\\n $g = 10$ \\\\\\n $m = 20$ \\\\\\n #lorem(10)\\n ],\\n given-width: 6em,\\n find: [\\n $F$ --- ?\\n ],\\n)[]\\n
\\nYou may locate you figure on the center of body by fig-align: top + center
#task(\\n given: [\\n $mu = 0.4$ \\\\\\n $g = 10$ \\\\\\n $m = 20$\\n ],\\n find: [\\n $F$ --- ?\\n ],\\n fig: image(\\"./example.png\\", width: 60%),\\n fig-align: top + center\\n)[\\n #lorem(100)\\n]\\n
\\nA Typst theme for a nice and simple looking letter that\'s not completely black and white. Inspired by a Canva theme.
\\nFeatures:
\\n| Basic example | Short text (vertically centered) | Multi-page overflowing text |\\n|----------------------------------------------------------|--------------------------------------------------------|------------------------------------------------------|\\n| .rendered/demo_medium.pdf
| .rendered/demo_short.pdf
| .rendered/demo_long.pdf
|
show
statement#import \\"@preview/fireside:1.0.0\\": *\\n\\n#show: project.with(\\n title: [Anakin \\\\ Skywalker],\\n from-details: [\\n Appt. x, \\\\\\n Mos Espa, \\\\\\n Tatooine \\\\\\n anakin\\\\@example.com \\\\ +999 xxxx xxx\\n ],\\n to-details: [\\n Sheev Palpatine \\\\\\n 500 Republica, \\\\\\n Ambassadorial Sector, Senate District, \\\\\\n Galactic City, \\\\ Coruscant\\n ],\\n)\\n\\nDear Emperor, ...\\n
\\n.demo/demo_long.typ
(line 3) background: rgb(\\"f4f1eb\\"), # Override the background color\\n title: \\"\\", # Set the top-left title. It looks best on two lines\\n from-details: none, # Letter sender (you) details\\n to-details: none, # Letter receiver details\\n margin: 2.1cm, # Page margin\\n vertical-center-level: 2, # When the content is small, it is vertically centered a bit, but still kept closer to the top. This controls how much. Setting to none will disable centering.\\n body\\n
\\nlib.typ
is licensed as MIT (https://opensource.org/license/mit)A Typst template for lab reports at INSA Lyon.
\\n\\n \\n \\n \\n
\\n\\nNote : Voir aussi le README.FR.md en français.
\\n
This template targets french students, thus labels will be in french, see Notes.
\\nIt is available on Typst Universe : @preview/ttuile:0.1.1
.
If you wish to use it in a fully local manner, you\'ll need to either manually include ttuile.typ
and logo-insa-lyon.png
in your project\'s root directory ; or upload them to the Typst web app if that\'s what you use.
You\'ll find these files in the releases section.
\\nYour folder structure should then look something like this :
\\n.\\n├── ttuile.typ\\n├── logo-insa-lyon.png\\n└── main.typ\\n
\\nThe template is now ready to be used, and can be called supplying the following arguments.\\n?
means the argument can be null if not applicable.
| Argument | Default value | Type | Description |\\n|:--------:|:-------------:|:----:|:------------|\\n| titre
| none
| content?
| The title of your report. |\\n| auteurs
| none
| array<str> \\\\| content?
| One or multiple authors to be credited in the report. |\\n| groupe
| none
| content?
| Your class number/letter/identifier. Will be displayed right after the author(s). |\\n| numero-tp
| none
| content?
| The number/identifier of the lab work/practical you\'re writing this report for. |\\n| numero-poste
| none
| content?
| Number of your lab bench. |\\n| date
| none
| datetime \\\\| content?
| Date at which the lab work/practical was carried out. |\\n| sommaire
| true
| bool
| Display the table of contents ? |\\n| logo
| image(\\"logo-insa-lyon.png\\")
| image?
| University logo to use. |\\n| point-legende
| false
| bool
| Enable automatic enforcement of full stops at the end of figures\' captions. (still somewhat experimental). |
A single positional argument is accepted, being the report\'s body.
\\nYou can call the template using the following syntax :
\\n// Local import\\n// #import \\"ttuile.typ\\": *\\n\\n// Universe import\\n#import \\"@preview/ttuile:0.1.1\\": *\\n\\n#show: ttuile.with(\\n titre: [« #lorem(8) »],\\n auteurs: (\\n \\"Theresa Tungsten\\",\\n \\"Jean Dupont\\",\\n \\"Eugene Deklan\\",\\n ),\\n groupe: \\"TD0\\",\\n numero-tp: 0,\\n numero-poste: \\"0\\",\\n date: datetime.today(),\\n // sommaire: false,\\n // logo: image(\\"path_to/logo.png\\"),\\n // point-legende: true,\\n)\\n
\\nThe package ttuile.typ
exposes multiple functions, find out more about them in the documentation.
\\n \\n To the documentation\\n \\n
\\nAn example file is also available in template/main.typ
Beware, all of the labels will be in french (authors != auteurs, appendix != annexe, ...)
\\nIf you really want to use this template despite not being an INSA student, you can probably figure out what to change in the code (namely labels mentioned above). You can remove the INSA logo by setting logo: none
Should you still need help, no worries, feel free to reach out !
\\nThe code - variable names and comments - is all in french. That\'s on me, I didn\'t really think it through when first writing the template haha. I might consider translating sometime in the future.
\\nThe MIT license doesn\'t apply to the file logo-insa-lyon.png
, it was retrieved from INSA Lyon - éléments graphiques. It doesn\'t apply either to the \\"INSA\\" branding.
Contributions are welcome ! Parts of the template are very much spaghetti code, especially where the spacing between different headings is handled (seriously, it\'s pretty bad).
\\nIf you know the proper way of doing this, an issue or PR would be greatly appreciated :)
\\n","description":"A Typst template for lab reports at INSA Lyon. Note : Voir aussi le README.FR.md en français.\\n\\n🧭 Table of contents\\nUsage\\nDocumentation\\nNotes\\nContributing\\n📎 Usage\\n\\nThis template targets french students, thus labels will be in french…","guid":"https://typst.app/universe/package/ttuile","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-06T08:33:55.944Z","media":[{"url":"https://github.com/vitto4/ttuile/blob/main/assets/ttuile-header.png?raw=true","type":"photo","width":6850,"height":816},{"url":"https://img.shields.io/badge/Typst-%232f90ba.svg?&logo=Typst&logoColor=white","type":"photo","width":59,"height":20},{"url":"https://img.shields.io/github/license/vitto4/ttuile","type":"photo","width":78,"height":20},{"url":"https://img.shields.io/github/v/release/vitto4/ttuile","type":"photo","width":94,"height":20},{"url":"https://github.com/vitto4/ttuile/blob/main/assets/ttuile-banner.png?raw=true","type":"photo","width":3776,"height":1787}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"oxifmt (0.2.1) | Convenient Rust-like string formatting in Typst","url":"https://typst.app/universe/package/oxifmt","content":"A Typst library that brings convenient string formatting and interpolation through the strfmt
function. Its syntax is taken directly from Rust\'s format!
syntax, so feel free to read its page for more information (https://doc.rust-lang.org/std/fmt/); however, this README should have enough information and examples for all expected uses of the library. Only a few things aren\'t supported from the Rust syntax, such as the p
(pointer) format type, or the .*
precision specifier.
A few extras (beyond the Rust-like syntax) will be added over time, though (feel free to drop suggestions at the repository: https://github.com/PgBiel/typst-oxifmt). The first \\"extra\\" so far is the fmt-decimal-separator: \\"string\\"
parameter, which lets you customize the decimal separator for decimal numbers (floats) inserted into strings. E.g. strfmt(\\"Result: {}\\", 5.8, fmt-decimal-separator: \\",\\")
will return the string \\"Result: 5,8\\"
(comma instead of dot). See more below.
Compatible with: Typst v0.4.0+
\\nYou can use this library through Typst\'s package manager (for Typst v0.6.0+):
\\n#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n
\\nFor older Typst versions, download the oxifmt.typ
file either from Releases or directly from the repository. Then, move it to your project\'s folder, and write at the top of your Typst file(s):
#import \\"oxifmt.typ\\": strfmt\\n
\\nDoing the above will give you access to the main function provided by this library (strfmt
), which accepts a format string, followed by zero or more replacements to insert in that string (according to {...}
formats inserted in that string), an optional fmt-decimal-separator
parameter, and returns the formatted string, as described below.
Its syntax is almost identical to Rust\'s format!
(as specified here: https://doc.rust-lang.org/std/fmt/). You can escape formats by duplicating braces ({{
and }}
become {
and }
). Here\'s an example (see more examples in the file tests/strfmt-tests.typ
):
#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"I\'m {}. I have {num} cars. I\'m {0}. {} is {{cool}}.\\", \\"John\\", \\"Carl\\", num: 10)\\n#assert.eq(s, \\"I\'m John. I have 10 cars. I\'m John. Carl is {cool}.\\")\\n
\\nNote that {}
extracts positional arguments after the string sequentially (the first {}
extracts the first one, the second {}
extracts the second one, and so on), while {0}
, {1}
, etc. will always extract the first, the second etc. positional arguments after the string. Additionally, {bananas}
will extract the named argument \\"bananas\\".
You can use {:spec}
to customize your output. See the Rust docs linked above for more info, but a summary is below.
(You may also want to check out the examples at Examples.)
\\n?
at the end of spec
(that is, writing e.g. {0:?}
) will call repr()
to stringify your argument, instead of str()
. Note that this only has an effect if your argument is a string, an integer, a float or a label()
/ <label>
- for all other types (such as booleans or elements), repr()
is always called (as str()
is unsupported for those).\\n?
(and thus repr()
) has the effect of printing them with double quotes. For floats, this ensures a .0
appears after it, even if it doesn\'t have decimal digits. For integers, this doesn\'t change anything. Finally, for labels, the <label>
(with ?
) is printed as <label>
instead of label
.?
when you\'re inserting something that isn\'t a string, number or label, in order to ensure consistent results even if the library eventually changes the non-?
representation.:
, add e.g. _<8
to align the string to the left, padding it with as many _
s as necessary for it to be at least 8
characters long (for example). Replace <
by >
for right alignment, or ^
for center alignment. (If the _
is omitted, it defaults to \' \' (aligns with spaces).)\\n8
there) as a separate argument to strfmt
instead, you can specify argument$
in place of the width, which will extract it from the integer at argument
. For example, _^3$
will center align the output with _
s, where the minimum width desired is specified by the fourth positional argument (index 3
), as an integer. This means that a call such as strfmt(\\"{:_^3$}\\", 1, 2, 3, 4)
would produce \\"__1__\\"
, as 3$
would evaluate to 4
(the value at the fourth positional argument/index 3
). Similarly, named$
would take the width from the argument with name named
, if it is an integer (otherwise, error).+
after the :
to ensure zero or positive numbers are prefixed with +
before them (instead of having no sign). -
is also accepted but ignored (negative numbers always specify their sign anyways).:09
to add zeroes to the left of the number until it has at least 9 digits / characters.\\n9
here is also a width, so the same comment from before applies (you can add $
to take it from an argument to the strfmt
function).:.5
to ensure your float is represented with 5 decimal digits of precision (zeroes are added to the right if needed; otherwise, it is rounded, not truncated).\\nwidth
, the precision can also be specified via an argument with the $
syntax: .5$
will take the precision from the integer at argument number 5 (the sixth one), while .test$
will take it from the argument named test
.x
(lowercase hex) or X
(uppercase) at the end of the spec
to convert the number to hexadecimal. Also, b
will convert it to binary, while o
will convert to octal.\\n#x
or #b
, to prepend the corresponding base prefix to the base-converted number, e.g. 0xABC
instead of ABC
.e
or E
at the end of the spec
to ensure the number is represented in scientific notation (with e
or E
as the exponent separator, respectively).fmt-decimal-separator: \\",\\"
to strfmt
to have the decimal separator be a comma instead of a dot, for example.\\nstrfmt
, such as using #let strfmt = strfmt.with(fmt-decimal-separator: \\",\\")
..5
) are ignored when the argument is not a number, but e.g. a string, even if it looks like a number (such as \\"5\\"
).<
, >
or ^
) -> sign (+
or -
) -> #
-> 0
(for 0 left-padding of numbers) -> width (e.g. 8
from 08
or 9
from -<9
) -> .precision
-> spec type (?
, x
, X
, b
, o
, e
, E
)).Some examples:
\\n#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s1 = strfmt(\\"{0:?}, {test:+012e}, {1:-<#8x}\\", \\"hi\\", -74, test: 569.4)\\n#assert.eq(s1, \\"\\\\\\"hi\\\\\\", +00005.694e2, -0x4a---\\")\\n\\n#let s2 = strfmt(\\"{:_>+11.5}\\", 59.4)\\n#assert.eq(s2, \\"__+59.40000\\")\\n\\n#let s3 = strfmt(\\"Dict: {:!<10?}\\", (a: 5))\\n#assert.eq(s3, \\"Dict: (a: 5)!!!!\\")\\n
\\n#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"First: {}, Second: {}, Fourth: {3}, Banana: {banana} (brackets: {{escaped}})\\", 1, 2.1, 3, label(\\"four\\"), banana: \\"Banana!!\\")\\n#assert.eq(s, \\"First: 1, Second: 2.1, Fourth: four, Banana: Banana!! (brackets: {escaped})\\")\\n
\\nrepr()
with {:?}
(which adds quotes around strings, and other things - basically represents a Typst value):#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"The value is: {:?} | Also the label is {:?}\\", \\"something\\", label(\\"label\\"))\\n#assert.eq(s, \\"The value is: \\\\\\"something\\\\\\" | Also the label is <label>\\")\\n
\\nrepr()
, even without {...:?}
, although that is more explicit):#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"Values: {:?}, {1:?}, {stuff:?}\\", (test: 500), (\\"a\\", 5.1), stuff: [a])\\n#assert.eq(s, \\"Values: (test: 500), (\\\\\\"a\\\\\\", 5.1), [a]\\")\\n
\\n{:x<8}
, where x
is the character to pad with (e.g. space or _
, but can be anything), <
is the alignment of the original text relative to the padding (can be <
for left aligned (padding goes to the right), >
for right aligned (padded to its left) and ^
for center aligned (padded at both left and right)), and 8
is the desired total width (padding will add enough characters to reach this width; if the replacement string already has this width, no padding will be added):#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"Left5 {:-<5}, Right6 {:=>6}, Center10 {centered: ^10?}, Left3 {tleft:_<3}\\", \\"xx\\", 539, tleft: \\"okay\\", centered: [a])\\n#assert.eq(s, \\"Left5 xx---, Right6 ===539, Center10 [a] , Left3 okay\\")\\n// note how \'okay\' didn\'t suffer any padding at all (it already had at least the desired total width).\\n
\\n{:08}
for 8 characters (for instance) - note that any characters in the number\'s representation matter for width (including sign, dot and decimal part):#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"Left-padded7 numbers: {:07} {:07} {:07} {3:07}\\", 123, -344, 44224059, 45.32)\\n#assert.eq(s, \\"Left-padded7 numbers: 0000123 -000344 44224059 0045.32\\")\\n
\\n8
in {:08}
or {: ^8}
) to be passed via parameter (instead of being hardcoded into the format string), you can specify parameter$
in place of the width, e.g. {:02$}
to take it from the third positional parameter, or {:a>banana$}
to take it from the parameter named banana
- note that the chosen parameter must be an integer (desired total width):#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"Padding depending on parameter: {0:02$} and {0:a>banana$}\\", 432, 0, 5, banana: 9)\\n#assert.eq(s, \\"Padding depending on parameter: 00432 aaaaaa432\\") // widths 5 and 9\\n
\\n+
on positive numbers: Just add a +
at the \\"beginning\\", i.e., before the #0
(if either is there), or after the custom fill and align (if it\'s there and not 0
- see Grammar for the exact positioning), like so:#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"Some numbers: {:+} {:+08}; With fill and align: {:_<+8}; Negative (no-op): {neg:+}\\", 123, 456, 4444, neg: -435)\\n#assert.eq(s, \\"Some numbers: +123 +0000456; With fill and align: +4444___; Negative (no-op): -435\\")\\n\\n
\\nb
(binary), o
(octal), x
(lowercase hexadecimal) or X
(uppercase hexadecimal). You can also add a #
between +
and 0
(see the exact position at the Grammar) to display a base prefix before the number (i.e. 0b
for binary, 0o
for octal and 0x
for hexadecimal):#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"Bases (10, 2, 8, 16(l), 16(U):) {0} {0:b} {0:o} {0:x} {0:X} | W/ prefixes and modifiers: {0:#b} {0:+#09o} {0:_>+#9X}\\", 124)\\n#assert.eq(s, \\"Bases (10, 2, 8, 16(l), 16(U):) 124 1111100 174 7c 7C | W/ prefixes and modifiers: 0b1111100 +0o000174 ____+0x7C\\")\\n
\\n?
), if there\'s any), either .precision
(hardcoded, e.g. .8
for 8 decimal digits) or .parameter$
(taking the precision value from the specified parameter, like with width
):#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"{0:.8} {0:.2$} {0:.potato$}\\", 1.234, 0, 2, potato: 5)\\n#assert.eq(s, \\"1.23400000 1.23 1.23400\\")\\n
\\ne
(lowercase) or E
(uppercase) as specifier types (can be combined with precision):#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"{0:e} {0:E} {0:+.9e} | {1:e} | {2:.4E}\\", 124.2312, 50, -0.02)\\n#assert.eq(s, \\"1.242312e2 1.242312E2 +1.242312000e2 | 5e1 | -2.0000E-2\\")\\n
\\nfmt-decimal-separator: \\",\\"
(comma as an example):#import \\"@preview/oxifmt:0.2.1\\": strfmt\\n\\n#let s = strfmt(\\"{0} {0:.6} {0:.5e}\\", 1.432, fmt-decimal-separator: \\",\\")\\n#assert.eq(s, \\"1,432 1,432000 1,43200e0\\")\\n
\\nHere\'s the grammar specification for valid format spec
s (in {name:spec}
), which is basically Rust\'s format:
format_spec := [[fill]align][sign][\'#\'][\'0\'][width][\'.\' precision]type\\nfill := character\\nalign := \'<\' | \'^\' | \'>\'\\nsign := \'+\' | \'-\'\\nwidth := count\\nprecision := count | \'*\'\\ntype := \'\' | \'?\' | \'x?\' | \'X?\' | identifier\\ncount := parameter | integer\\nparameter := argument \'$\'\\n
\\nNote, however, that precision of type .*
is not supported yet and will raise an error.
Please report any issues or send any contributions (through pull requests) to the repository at https://github.com/PgBiel/typst-oxifmt
\\nIf you wish to contribute, you may clone the repository and test this package with the following commands (from the project root folder):
\\ngit clone https://github.com/PgBiel/typst-oxifmt\\ncd typst-oxifmt/tests\\ntypst c strfmt-tests.typ --root ..\\n
\\nThe tests succeeded if you received no error messages from the last command (please ensure you\'re using a supported Typst version).
\\noxifmt
!oxifmt:0.2.0
is now available through Typst\'s Package Manager! You can now write #import \\"@preview/oxifmt:0.2.0\\": strfmt
to use the library.strfmt
.MIT-0 license (see the LICENSE
file).
This is my CV template written in Typst. You can find a two example CVs in this repository as PDFs:
\\nTo use the CV you have to install the font awesome fonts for the icons to work. Please refer to the intstructons of the font awesome package itself. You can find these on:\\n- Typst Universe\\n- GitHub.
\\nheader
: Creates a page haeder including your name, current job title or any other sub title, socials and profile picture
full-name
: your full namejob-title
: your current job title rendered below your namesocials
: array containing all socials. Every social must have the following properties: icon
, link
and text
profile-picture
: path to your profile picturesection
: Creates a new section, e. g. Professional Experience
or Education
title
: section\'s titleentry
: Adds an entry / item to the current section
title
: the entry\'s title, e. g. your job titlecompany-or-university
: the name of the institution which you were at, e. g. company or universitydate
: start and end date of this entry, e. g. 2020 - 2022location
: describes where you worked, e. g. London, UKlogo
: path to the logo of this entryIn the folder settings
you will a file styles.typ
which includes all used styles. You can customize them as you want to.
If you want to add a new language, copy the cv-en.typ
and rename it. Afterwards you can adapt the text correspondingly. Maybe I will introduce i18n in the future.
A big thanks to brilliant-CV as this project was an inspiraton for my CV and for the scripting.
\\nIf you have questions, plase create a discussion.\\nIf you have an issue, please create an issue.
\\n","description":"This is my CV template written in Typst. You can find a two example CVs in this repository as PDFs: German CV\\nEnglish CV\\nSetup\\n\\nTo use the CV you have to install the font awesome fonts for the icons to work. Please refer to the intstructons of the font awesome package itself…","guid":"https://typst.app/universe/package/light-cv","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-06T08:13:19.708Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"fractusist (0.1.0) | Create a variety of wonderful fractals in Typst.","url":"https://typst.app/universe/package/fractusist","content":"Create a variety of wonderful fractals in Typst.
\\nThe example below creates a dragon curve of the 12th iteration with the dragon-curve
function.
#set page(width: auto, height: auto, margin: 0pt)\\n\\n#dragon-curve(\\n 12,\\n step-size: 6,\\n stroke-style: stroke(\\n paint: gradient.linear(..color.map.crest, angle: 45deg),\\n thickness: 3pt,\\n cap: \\"square\\"\\n )\\n)\\n
\\nImport the latest version of this package with:
\\n#import \\"@preview/fractusist:0.1.0\\": *\\n
\\nEach function generates a specific fractal. The input and output arguments of all functions have a similar style. Typical input arguments are as follows:
\\nn
: the number of iterations (the valid range of values depends on the specific function).step-size
: step size (in pt).fill-style
: fill style, can be none
or color or gradient (exists only when the curve is closed).stroke-style
: stroke style, can be none
or color or gradient or stroke object.width
: the width of the image.height
: the height of the image.fit
: how the image should adjust itself to a given area, \\"cover\\" / \\"contain\\" / \\"stretch\\".The content returned is the image
element.
For more codes with these functions see tests.
\\ndragon-curve
: Generate dragon curve (n: range [0, 16]).#let dragon-curve(n, step-size: 10, stroke-style: black + 1pt, width: auto, height: auto, fit: \\"cover\\") = {...}\\n
\\nhilbert-curve
: Generate 2D Hilbert curve. (n: range [1, 8]).#let hilbert-curve(n, step-size: 10, stroke-style: black + 1pt, width: auto, height: auto, fit: \\"cover\\") = {...}\\n
\\npeano-curve
: Generate 2D Peano curve (n: range [1, 5]).#let peano-curve(n, step-size: 10, stroke-style: black + 1pt, width: auto, height: auto, fit: \\"cover\\") = {...}\\n
\\nkoch-curve
: Generate Koch curve (n: range [0, 6]).#let koch-curve(n, step-size: 10, stroke-style: black + 1pt, width: auto, height: auto, fit: \\"cover\\") = {...}\\n
\\nkoch-snowflake
: Generate Koch snowflake (n: range [0, 6]).#let koch-snowflake(n, step-size: 10, fill-style: none, stroke-style: black + 1pt, width: auto, height: auto, fit: \\"cover\\") = {...}\\n
\\nsierpinski-curve
: Generate classic Sierpiński curve (n: range [0, 7]).#let sierpinski-curve(n, step-size: 10, fill-style: none, stroke-style: black + 1pt, width: auto, height: auto, fit: \\"cover\\") = {...}\\n
\\nsierpinski-square-curve
: Generate Sierpiński square curve (n: range [0, 7]).#let sierpinski-square-curve(n, step-size: 10, fill-style: none, stroke-style: black + 1pt, width: auto, height: auto, fit: \\"cover\\") = {...}\\n
\\nsierpinski-arrowhead-curve
: Generate Sierpiński arrowhead curve (n: range [0, 8]).#let sierpinski-arrowhead-curve(n, step-size: 10, stroke-style: black + 1pt, width: auto, height: auto, fit: \\"cover\\") = {...}\\n
\\nsierpinski-triangle
: Generate 2D Sierpiński triangle (n: range [0, 6]).#let sierpinski-triangle(n, step-size: 10, fill-style: none, stroke-style: black + 1pt, width: auto, height: auto, fit: \\"cover\\") = {...}\\n
\\n","description":"Create a variety of wonderful fractals in Typst. Examples\\n\\nThe example below creates a dragon curve of the 12th iteration with the dragon-curve function.\\n\\nShow code\\n#set page(width: auto, height: auto, margin: 0pt)\\n\\n#dragon-curve(\\n 12,\\n step-size: 6,\\n stroke-style: stroke(…","guid":"https://typst.app/universe/package/fractusist","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-06T07:55:27.665Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/fractusist/0.1.0/examples/dragon-curve-n12.png","type":"photo","width":773,"height":517}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"guided-resume-starter-cgc (2.0.0) | A guided starter resume for people looking to focus on highlighting their experience -- without having to worry ab...","url":"https://typst.app/universe/package/guided-resume-starter-cgc","content":"This template is a starter resume for people looking to focus on the content of their resume, without having to worry about the hassle of formatting.
\\nThere are two files included in this project:
\\nstarter.typ
contains the full template, along with a written guide to help you put your best (single-paged) foot forward!resume.typ
is the same template, but without the full guide included.templates/resume.template.typ
contains the formatting and style for the underlying pieces.I would highly recommend reading starter.typ
or skimming through the online guide to understand best practices when using the template.
If you\'d prefer to simply download & modify the template, you can use the Typst CLI to download it instead:
\\ntypst init @preview/resume-starter-cgc\\n
\\nThe resume can be created with a header with the following attributes:
\\nauthor
: Your namelocation
: The city, state/province, and country you reside in.contacts
: A list of contact information and additional information#show: resume.with(\\n author: \\"Dr. Emmit \\\\\\"Doc\\\\\\" Brown\\",\\n location: \\"Hill Valley, CA\\",\\n contacts: (\\n [#link(\\"mailto:your_email@yourmail.com\\")[Email]],\\n [#link(\\"https://your-cool-site.com\\")[Website]],\\n [#link(\\"https://github.com/your-linkedin\\")[GitHub]],\\n [#link(\\"https://linkedin.com/in/your-linkedin\\")[LinkedIn]],\\n )\\n)\\n
\\nThe Education (#edu
) section can be used to highlight for formal education and certifications.
institution
: Name of the institution where you study, or have graduated from.date
: Your graduation date, or expected graduation date.degrees
: The degrees you received at the institution\\ngpa
(optional): Your GPA, or other additional information.#edu(\\n institution: \\"University of Colombia\\",\\n date: \\"Aug 1948\\",\\n gpa: \\"3.9 of 4.0, Summa Cum Laude\\",\\n degrees: (\\n (\\"Bachelor\'s of Science\\", \\"Nuclear Engineering\\"),\\n (\\"Minors\\", \\"Automobile Design, Arabic\\"),\\n (\\"Focus\\", \\"Childcare, Education\\")\\n ),\\n)\\n
\\nAn additional Skills (#skills
) section to list skills relevant to the job you\'re applying for.
The input is a list of Label: Skills[]
, in order to easily toggle comments on skills that you may want to leave in but not render for a particular application.
#skills((\\n (\\"Expertise\\", (\\n [Theoretical Physics],\\n [Time Travel],\\n [Nuclear Material Management],\\n [Student Mentoring],\\n )),\\n (\\"Software\\", (\\n [AutoDesk CAD],\\n [Delorean OS],\\n [Windows 1],\\n )),\\n (\\"Languages\\", (\\n [C++],\\n [C Language],\\n [MatLab],\\n [Punch Cards],\\n )),\\n))\\n
\\nThe bulk of your resume, the Experience (#exp
) sections provide a compact & concise formatting for bulleted details of your previous and current work experience.
This section is meant to be flexible, and can also be used to talk about projects and other experiences that may fall outside of the traditional definition of \\"work.\\"
\\nrole
: The title of your position/role in this experience.project
: The company you worked at, or the name of the project you worked on.date
: The start and end dates of this experience.details
: A description of the work you did in this position\\nlocation
(optional): The location of the experiencesummary
(optional): A brief summary of the company\'s mission or project goal.#exp(\\n role: \\"Theoretical Physics Consultant\\",\\n project: \\"Doc Brown\'s Garage\\",\\n date: \\"June 1953 - Oct 2015\\",\\n location: \\"Hill Valley, CA\\",\\n summary: \\"Specializing in development of time travel devices and student tutoring\\",\\n details: [\\n - Lead development of time travel devices, resulting in the ability to travel back and forth through time\\n - Managed and executed a budget of \\\\$14 million dollars gained from an unexplained family fortune\\n - Oversaw QA testing for time travel devices, minimizing risk of maternal time-travel related incidents\\n ]\\n)\\n
\\nHave any questions, comments, or suggestions about the template? Please feel free to reach out at mentoring@chaoticgood.computer
!
This is a Typst diploma thesis template for students of the HTL Wien West. It fulfils all the necessary requirements for the diploma thesis.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the dashboard and searching for htlwienwest-da
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/htlwienwest-da\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the diplomarbeit
function with the following named arguments:
titel
: string
- The title of the thesisschuljahr
: string
- The current school yearabteilung
: string
- The student\'s departmentunterschrifts-datum
: string
- The submission dateautoren
: array(dict)
- An array of all authors, represented as dictionaries. Each of them has the following properties\\nvorname
: string
- Firstname of the studentnachname
: string
- Lastname of the studentklasse
: string
- School class of the studentbetreuer
: dict
- The student\'s advisor as dictionary\\nname
: string | content
- The advisor\'s namegeschlecht
: \\"male\\" | \\"female\\"
- Gender of advisor for correct genderingaufgaben
: content
- The student\'s responsibilitieskurzfassung
: content
- Abstract in german as content blockabstract
: content
- Abstract in english as content blockvorwort
: content
- The thesis\' prefacedanksagung
: content
- Acknowledgementanhang
: content | none
- Appendixliteraturverzeichnis
: function
- The bibliography prefilled with the BibTex file pathThe function also accepts a single, positional argument for the body of the paper.
\\nThe template will initialize your package with a sample call to the diplomarbeit
function in a show rule. If you want to change an existing project to use thistemplate, you can add a show rule like this at the top of your file:
#import \\"@preview/htlwienwest-da:0.1.0\\": *\\n\\n#show: diplomarbeit.with(\\n titel: \\"Titel der Diplomarbeit\\",\\n abteilung: \\"Informationstechnologie\\",\\n schuljahr: \\"2023/24\\",\\n unterschrifts-datum: \\"20.04.2024\\",\\n autoren: (\\n (\\n vorname: \\"Hans\\", nachname: \\"Mustermann\\",\\n klasse: \\"5AHITN\\",\\n betreuer: (name: \\"Dr. Walter Turbo\\", geschlecht: \\"male\\"),\\n aufgaben: [\\n #lorem(100)\\n ]\\n ),\\n (\\n vorname: \\"Herta\\", nachname: \\"Musterfrau\\",\\n klasse: \\"5AHITN\\",\\n betreuer: (name: \\"Dipl.-Ing Maria Kreisel\\", geschlecht: \\"female\\"),\\n aufgaben: [\\n #lorem(100)\\n ]\\n ),\\n kurzfassung: [\\n Die Kurzfassung muss die folgenden Inhalte darlegen (§8, Absatz 5 Prüfungsordnung): Thema, Fragestellung, Problemformulierung, wesentliche Ergebnisse. Sie soll einen prägnanten Überblick über die Arbeit geben.\\n ],\\n abstract: [\\n Englische Version der Kurzfassung (siehe #link(<Kurzfassung>)[_Kurzfassung_])\\n ],\\n vorwort: [\\n Perönlicher Zugang zum Thema. Gründe für die Themenwahl.\\n ],\\n danksagung: [\\n Dank an Personen, die bei der Erstellung der Arbeit unterstützt haben.\\n ],\\n anhang: include \\"anhang.typ\\", // entfernen falls nicht benötigt\\n literaturverzeichnis: bibliography.with(\\"literaturverzeichnis.bib\\")\\n)\\n\\n// Your content goes below.\\n
\\nBeside the diplomarbeit
function, the template also provides the autor
function that is used after a heading to indicate the specific author of the current section.
== Some Heading\\n#autor[Your Name]\\n
\\nThis will render additional information to the section\'s heading.
\\nTo install the template locally, you can use
\\njust install\\n
\\nwhich uses the just command runner.
\\nIf you don\'t want to install just
, you can run
bash ./scripts/package @local\\n
\\nThe installed version can be used via @local
instead of @preview
. To create a new typst project from the template, run
typst init @local/htlwienwest-da:<version-in-typst.toml>\\n
\\n","description":"This is a Typst diploma thesis template for students of the HTL Wien West. It fulfils all the necessary requirements for the diploma thesis. Usage\\n\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the dashboard and searching for htlwienwest-da.…","guid":"https://typst.app/universe/package/htlwienwest-da","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-05-03T09:44:54.490Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"wrap-indent (0.1.0) | Wrap content in custom functions with just indentation","url":"https://typst.app/universe/package/wrap-indent","content":"wrap-indent
is a package for wrapping content in custom functions\\nwith just indentation. This lets you avoid using trailing square brackets\\nto wrap content, instead you just indent it!
This system works by re-purposing Typst\'s existing\\nterm-list syntax via a\\ncustom show rule on terms.item
. We give it our custom function\\nwithin state\\nvia a new wrap-in()
function.
#set page(height: auto, width: 3.5in, margin: 0.25in)\\n\\n#import \\"@preview/wrap-indent:0.1.0\\": wrap-in, allow-wrapping\\n\\n#show terms.item: allow-wrapping\\n\\n/ First --:\\n A normal term list\\n\\n with multiple paragraphs\\n\\nBut this text is separated\\n\\n\\n#line(length: 100%)\\n\\n\\n#let custom-block(content) = rect(content,\\n fill: orange.lighten(90%),\\n stroke: 1.5pt + gradient.linear(..color.map.flare)\\n)\\n\\n/ #wrap-in(custom-block):\\n A *custom block* using the `wrap-in` function\\n\\n with indented text \\\\\\n over multiple lines\\n\\nAnd this text is _still_ separated!\\n
\\nAnd in its own code block, here\'s the required initialization:
\\n#import \\"@preview/wrap-indent:0.1.0\\": wrap-in, allow-wrapping\\n\\n#show terms.item: allow-wrapping\\n
\\n#set page(height: auto, width: 4.1in, margin: 0.25in)\\n\\n#show heading: set text(size: 0.75em)\\n#show heading: set block(below: 1em)\\n#set heading(numbering: \\"1) \\")\\n\\n= Normal function call:\\n\\n// A function for wrapping some text:\\n#let custom-quote(body) = rect(\\n body,\\n width: 100%,\\n fill: luma(95%),\\n stroke: (left: 2pt + luma(30%))\\n)\\n\\n#custom-quote[\\n Some text in a _custom quote_ spread over multiple lines\\n so it actually looks like it was typed in a document.\\n]\\nThis text is outside the quote box\\n\\n\\n= Wrappped function call!\\n\\n/ #wrap-in(custom-quote):\\n Some text in a _custom quote_ spread over multiple lines\\n so it actually looks like it was typed in a document.\\n\\nThis text is _still_ outside the quote box!\\n\\n\\n= Arbitrary functions should _just work#emoji.tm;_\\n\\n/ #wrap-in(x => ellipse(align(center, x),\\n stroke: 3pt + gradient.conic(..color.map.rainbow)\\n )):\\n Some text in a _rainbow ellipse_ spread\\n over multiple lines so it actually looks\\n like it was typed in a document.\\n\\n\\n= One-liners look great!\\n\\n/ #wrap-in(underline): Here\'s one line underlined\\n\\n\\n= Let\'s do some math:\\n\\n#let named-thm(name) = (content) => {\\n pad(left: 2em, par(hanging-indent: -2em)[\\n *Theorem* (#name) #emph(content)\\n ])\\n}\\n\\n/ #wrap-in(named-thm(\\"Operational Soundness\\")):\\n If $med tack e : tau$ and $e$ reduces to $e\'$\\n by zero or more steps and $\\"Irred\\"(e\')$,\\n then $e\' in \\"Val\\"$ and $med tack e\' : tau$.\\n\\n\\n= In-line styling doesn\'t create blocks:\\n\\n/ #wrap-in(highlight):\\n This text is highlighted.\\nThis text isn\'t.\\n\\nNotice how there was *no* paragraph break between the\\ntwo sentences? This is a useful result that makes\\n`wrap-indent` really flexible!\\n\\n(if you want separate blocks, use `block` in your function)\\n\\n\\n= Does it work with nesting?\\n\\n/ #wrap-in(custom-quote):\\n Testing...\\n / #wrap-in(align.with(center)):\\n / #wrap-in(rect):\\n / #wrap-in(emph):\\n Signs point to yes!\\n\\n\\n= Final thoughts\\n\\n/ Note --:\\n Regular term lists still work!\\n\\n/ Disclaimer --:\\n You may run into issues with other term list\\n show rules conflicting with this rule. \\\\\\n (although set rules should be unaffected)\\n\\n If you run into issues, _let me know!_ I\'d love to hear\\n about it to make this package as robust as possible.\\n\\n\\n= And\\n\\n#let big-statement(content) = {\\n align(center, text(\\n underline(stroke: 1.5pt, content),\\n size: 32pt,\\n weight: \\"bold\\",\\n style: \\"italic\\",\\n fill: eastern,\\n ))\\n}\\n\\n/ #wrap-in(big-statement):\\n That\'s a wrap!\\n
\\nYou can find my original writeup here for more context:
\\nhttps://typst.app/project/r5ogFas7lj7E48iHw_M4yh
And also see the GitHub issue that prompted me to make this:
\\nhttps://github.com/typst/typst/issues/1921
delimitizer
This package lets you customize the size of delimiters in your math equations. It is useful when you want to make your equations more readable by increasing the size of certain delimiters. Just like \\\\big
, \\\\Big
, \\\\bigg
, and \\\\Bigg
in LaTeX, delimitizer
provides you with the same functionality in Typst.
big(delimiter)
: Makes the delimiters bigger than the default size.Big(delimiter)
: Makes the delimiters bigger than big()
.bigg(delimiter)
: Makes the delimiters bigger than Big()
.Bigg(delimiter)
: Makes the delimiters bigger than bigg()
.scaled-delimiter(delimiter, size)
: Scales the delimiters by a factor of your choice.paired-delimiter(left, right)
: Make a short hand for paired delimiters. This function returns a closure f(size = auto: auto | none | big | Big | bigg | Bigg | relative, content: content)
. The keyed argument size
is optional and defaults to auto
. The positional argument content
is required.\\nsize
is auto
, the size of the delimiters is automatically determined.size
is none
, the size of the delimiters is 1em
.size
is big
/Big
/bigg
/Bigg
, the size of the delimiters is set to big
/Big
/bigg
/Bigg
respectively.size
is relative
length like 3em
or 150%
, the size of the delimiters is scaled by the factor you provide.Example:
\\n#let parn = paired-delimiter(\\"(\\", \\")\\")\\n\\n$\\nparn(size: bigg,\\n parn(size: big, (a+b)times (a-b))\\ndiv\\n parn(size: big, (c+d)times (c-d))\\n) + d \\\\ = (a^2-b^2) / (c^2-d^2)+d\\n$\\n\\n
\\nwhalogen is a library for typsetting chemical formulae with Typst, inspired by mhchem.
\\nGitHub repository: https://github.com/schang412/typst-whalogen
\\n#import \\"@preview/whalogen:0.2.0\\": ce\\n\\n$ #ce(\\"HCl + H2O -> H3O+ + Cl-\\") $\\n
\\nSee the manual for more details and examples.
\\n","description":"whalogen is a library for typsetting chemical formulae with Typst, inspired by mhchem. GitHub repository: https://github.com/schang412/typst-whalogen\\n\\nExamples\\n\\n#import \\"@preview/whalogen:0.2.0\\": ce\\n\\n$ #ce(\\"HCl + H2O -> H3O+ + Cl-\\") $\\n\\n\\nSee the manual for more details and examples…","guid":"https://typst.app/universe/package/whalogen","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-30T10:43:50.317Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/whalogen/0.2.0/gallery/example.png","type":"photo","width":543,"height":306}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"tuhi-course-poster-vuw (0.1.0) | A poster template for VUW course descriptions.","url":"https://typst.app/universe/package/tuhi-course-poster-vuw","content":"A Typst template for VUW course posters. To get started:
\\ntypst init @preview/tuhi-course-poster-vuw:0.1.0\\n
\\nAnd edit the main.typ
example.
PRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.
\\n","description":"A Typst template for VUW course posters. To get started: typst init @preview/tuhi-course-poster-vuw:0.1.0\\n\\n\\nAnd edit the main.typ example.\\n\\nContributing\\n\\nPRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.","guid":"https://typst.app/universe/package/tuhi-course-poster-vuw","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-30T09:03:02.289Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/tuhi-course-poster-vuw/0.1.0/thumbnail.png","type":"photo","width":2339,"height":3307}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"structured-uib (0.1.0) | Lab report template for the course PHYS114 at the University of Bergen.","url":"https://typst.app/universe/package/structured-uib","content":"Report template to be used for laboratory reports in the course PHYS114 - Basic Measurement Science and Experimental Physics, at the University of Bergen (https://www.uib.no/en/courses/PHYS114). The template is in Norwegian only as of now. English support may be added in the future.
\\nThe first part of the packages name is arbitrary, such that it follows the naming guidelines of Typst.
\\nNote: The template uses the fonts STIX Two Text and STIX Two Math (https://github.com/stipub/stixfonts/tree/master/fonts). If running Typst locally on your computer, make sure you have these fonts installed. There should be no font problems if you are using Typst via https://typst.app however.
\\nUsage:
\\n// IMPORTS\\n#import \\"@preview/structured-uib:0.1.0\\": *\\n\\n// TEMPLATE SETTINGS\\n#show: report.with(\\n task-no: \\"1\\",\\n task-name: \\"Måling og behandling av måledata\\",\\n authors: (\\n \\"Student Enersen\\",\\n \\"Student Toersen\\", \\n \\"Student Treersen\\"\\n ),\\n mails: (\\n \\"student.enersen@student.uib.no\\", \\n \\"student.toersen@student.uib.no\\", \\n \\"student.treersen@student.uib.no\\"\\n ),\\n group: \\"1-1\\",\\n date: \\"29. Apr. 2024\\",\\n supervisor: \\"Professor Professorsen\\",\\n)\\n\\n// CONTENT HERE...\\n
\\nFront page:\\n
lib.typ
is licensed under MIT. The contents of the template/
directory are licensed under MIT-0. The logo/emblem of the University of Bergen (located at media/uib-emblem.svg
) is owned by their respective owners.
Used to display code files in Typst. Main feature is that it displays code blocks over multiple pages in a way that implies the code block continues onto the next page. Also a simple and intuitive syntax for displaying code blocks.
\\nUsage:
\\n// IMPORT PACKAGE\\n#import \\"@preview/codedis:0.1.0\\": code\\n\\n// READ IN CODE\\n#let codeblock-1 = read(\\"some_code.py\\")\\n#let codeblock-2 = read(\\"some_code.cpp\\")\\n\\n#set page(numbering: \\"1\\")\\n#v(80%)\\n\\n// DEFAULT LANGUAGE IS Python (\\"py\\")\\n#code(codeblock-1)\\n#code(codeblock-2, lang: \\"cpp\\")\\n
\\nRenders to:\\n
It is very basic and limited, but it does what I need it too, and hope that it may be of help to others. I\'m most likely not going to develop it further than this.
\\n","description":"Used to display code files in Typst. Main feature is that it displays code blocks over multiple pages in a way that implies the code block continues onto the next page. Also a simple and intuitive syntax for displaying code blocks. Usage:\\n\\n// IMPORT PACKAGE\\n#import \\"@preview…","guid":"https://typst.app/universe/package/codedis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-29T17:27:10.860Z","media":[{"url":"https://github.com/AugustinWinther/codedis/assets/30674646/76bb13d5-adc8-457f-bd55-53e3fd5c5df7","type":"photo","width":1011,"height":745}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"linguify (0.4.1) | Load strings for different languages easily","url":"https://typst.app/universe/package/linguify","content":"Load strings for different languages easily. This can be useful if you create a package or template for multilingual usage.
\\nThe usage depends if you are using it inside a package or a template or in your own document.
\\nYou can use linguify global database.
\\nExample:
\\n#import \\"@preview/linguify:0.4.0\\": *\\n\\n#let lang_data = toml(\\"lang.toml\\")\\n#set-database(lang_data);\\n\\n#set text(lang: \\"de\\")\\n\\n#linguify(\\"abstract\\") // Shows \\"Zusammenfassung\\" in the document.\\n
\\nThe lang.toml
musst look like this:
[conf]\\ndefault-lang = \\"en\\"\\n\\n[en]\\ntitle = \\"A simple linguify example\\"\\nabstract = \\"Abstract\\"\\n\\n[de]\\ntitle = \\"Ein einfaches Linguify Beispiel\\"\\nabstract = \\"Zusammenfassung\\"\\n
\\nSo that multiple packages can use linguify simultaneously, they should contain their own database. A linguify database is just a dictionary with a certain structure. (See database structure.)
\\nRecommend is to store the database in a separate file like lang.toml
and load it inside the document. And specify it in each linguify()
function call.
Example:
\\n#import \\"@preview/linguify:0.4.0\\": *\\n\\n#let database = toml(\\"lang.toml\\")\\n\\n#linguify(\\"key\\", from: database, default: \\"key\\")\\n
\\ntoml
or other file to load strings for different languages. You need to pass a typst dictionary which follows the structure of the shown toml file.en
A Typst template to quickly make reports for projects at ENSIAS. This template was created based on our reports that we also made for our projects.
\\nFor now, it provides a first page style that matches the common reports style used and encouraged at ENSIAS.
\\nIt also provides a style for first level headings to act as chapters.
\\nMore improvements will come soon.
\\n#import \\"@preview/red-agora:0.1.1\\": project\\n\\n#show: project.with(\\n title: \\"Injecting a backdoor in the xz library and taking over NASA and SpaceX spaceship tracking servers (for education purposes only)\\",\\n subtitle: \\"Second year internship report\\",\\n authors: (\\n \\"Amine Hadnane\\",\\n \\"Mehdi Essalehi\\"\\n ),\\n school-logo: image(\\"images/ENSIAS.svg\\"), // Replace with [] to remove the school logo\\n company-logo: image(\\"images/company.svg\\"),\\n mentors: (\\n \\"Pr. John Smith (Internal)\\",\\n \\"Jane Doe (External)\\"\\n ),\\n jury: (\\n \\"Pr. John Smith\\",\\n \\"Pr. Jane Doe\\"\\n ),\\n branch: \\"Software Engineering\\",\\n academic-year: \\"2077-2078\\",\\n french: false // Use french instead of english\\n footer-text: \\"ENSIAS\\" // Text used in left side of the footer\\n)\\n\\n// Put then your content here\\n
\\n0.1.0 - Initial release
\\n0.1.1
\\nwordometer
A small Typst package for quick and easy in-document word counts.
\\n#import \\"@preview/wordometer:0.1.3\\": word-count, total-words\\n\\n#show: word-count\\n\\nIn this document, there are #total-words words all up.\\n\\n#word-count(total => [\\n The number of words in this block is #total.words\\n and there are #total.characters letters.\\n])\\n
\\nYou can exclude elements by name (e.g., \\"caption\\"
), function (e.g., figure.caption
), where-selector (e.g., raw.where(block: true)
), or label (e.g., <no-wc>
).
#show: word-count.with(exclude: (heading.where(level: 1), strike))\\n\\n= This Heading Doesn\'t Count\\n== But I do!\\n\\nIn this document #strike[(excluding me)], there are #total-words words all up.\\n\\n#word-count(total => [\\n You can exclude elements by label, too.\\n #[That was #total.words, excluding this sentence!] <no-wc>\\n], exclude: <no-wc>)\\n
\\nlocate()
for Typst >=0.12.0
(No changes 🤡)
\\nelement.where(..)
selectors功能需求、合作开发请移步模板对应的 github 仓库:modern-sustech-thesis.
\\n使用步骤:
\\n打开 typst.app 从模板新建项目(start from template)
\\n论文所需字体需要手动上传到你的项目文件列表.
\\n点击左侧 Explore Files,上传字体文件,上传后的字体文件存储位置没有特殊要求,typst 拥有优秀的内核,可以完成自动搜索.
\\n由于格式渲染引擎的核心需要指定字体的名称,我在模板测试阶段使用了若干标准字体,这些字体可以在我的 github 仓库 modern-sustech-thesis /template/fonts 里找到.
\\n此外,可以手动更改字体配置,在正文前使用 \'#set\' 命令即可,由于标题、正文字体不同,此处大致语法如下:
\\n// headings\\n show heading.where(level: 1): it =>{\\n set text(\\n font: fonts.HeiTi,\\n size: fonts.No3,\\n weight: \\"regular\\",\\n )\\n align(center)[\\n // #it\\n #strong(it)\\n ]\\n text()[#v(0.5em)]\\n }\\n\\n show heading.where(level: 2): it =>{\\n set text(\\n font: fonts.HeiTi,\\n size: fonts.No4,\\n weight: \\"regular\\"\\n )\\n it\\n text()[#v(0.5em)]\\n }\\n\\n show heading.where(level: 3): it =>{\\n set text(\\n font: fonts.HeiTi,\\n size: fonts.No4-Small,\\n weight: \\"regular\\"\\n )\\n it\\n text()[#v(0.5em)] \\n }\\n\\n // paragraph\\n set block(spacing: 1.5em)\\n set par(\\n justify: true,\\n first-line-indent: 2em,\\n leading: 1.5em)\\n
\\nheadings 设定了各个登记标题的格式,其中一级标题需要居中对齐.\\n\'font: fonts.HeiTi\' 即为字体的关键参数,参数的值是字体的名称(字符串). typst 将会在编译器内核、项目目录中搜索. typst 内核自带了 Source Sans(黑体)和 Source Serif(宋体)系列,但是中文论文所需的仿宋、楷体仍需自己上传.
\\n按照毕业设计要求,以 markdown 格式书写你的毕业论文,只需要:
\\n在 configs/info 里填入个人信息.\\n如有标题编译错误(比如我默认了有三行标题),可以自行按照编译器提示把相关代码注释或者修改. 大体语法和内容与基本的编程语言无差别.
\\n在 content.typ 里以 typst 特定的 markdown 语法书写你的论文内容.\\n有关 typst 中 markdown 的语法变更,个人认为的主要变化罗列如下:
\\n自定义格式的思路.\\n如有额外的需要自定义格式的需求,可以自行学习 \'#set\', \'#show\' 命令,这可能需要一定的编程语言知识,后续我会更新部分简略教程在我的 github 仓库里:https://github.com/Duolei-Wang/lang-typst.
\\n本模板的结构
\\n版本号:0.1.1
\\nTODO:
\\n南方科技大学本科毕业设计(论文)模板,论文格式参照 南方科技大学本科生毕业设计(论文)撰写规范. 如有疏漏敬请谅解,本模板为本人毕业之前自用,如有使用,稳定性请自行负责.
\\n本模板主要参考了 iydon 仓库的的 $\\\\LaTeX$ 模板 sustechthesis;结构组织参照了 shuosc 仓库的 SHU-Bachelor-Thesis-Typst 模板;图片素材使用了 GuTaoZi 的同内容仓库里的模板.
\\n感谢 SHU-Bachelor-Thesis 的结构组织让我学习到了很多,给我的页面组织提供了灵感,
\\n在查找图片素材的时候,使用了 GuTaoZi 仓库 SUSTech-thesis-typst 里的svg 素材,特此感谢.
\\n本模板、仓库处于个人安利 typst 的需要——在线模板需上传至 typst/packages 官方仓库才能被搜索到,如有开发和接管等需求请务必联系我:
\\nQQ: 782564506
\\nmail: wangdl2020@mail.sustech.edu.cn
\\n","description":"功能需求、合作开发请移步模板对应的 github 仓库:modern-sustech-thesis. typst.app 网页版使用说明 (Use online)\\n\\n使用步骤:\\n\\n打开 typst.app 从模板新建项目(start from template)\\n\\n论文所需字体需要手动上传到你的项目文件列表.\\n\\n点击左侧 Explore Files,上传字体文件,上传后的字体文件存储位置没有特殊要求,typst 拥有优秀的内核,可以完成自动搜索.\\n\\n由于格式渲染引擎的核心需要指定字体的名称,我在模板测试阶段使用了若干标准字体,这些字体可以在我的…","guid":"https://typst.app/universe/package/modern-sustech-thesis","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-29T14:12:43.582Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"smooth-tmlr (0.4.0) | Paper template for submission to Transaction on Machine Learning Research (TMLR)","url":"https://typst.app/universe/package/smooth-tmlr","content":"You can use this template in the Typst web app by clicking Start from\\ntemplate on the dashboard and searching for smooth-tmlr
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/smooth-tmlr\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nHere are an example paper in LaTeX and in Typst.
\\nThis template exports the tmlr
function with the following named arguments.
title
: The paper\'s title as content.authors
: An array of author dictionaries. Each of the author dictionaries\\nmust have a name key and can have the keys department, organization,\\nlocation, and email.keywords
: Publication keywords (used in PDF metadata).date
: Creation date (used in PDF metadata).abstract
: The content of a brief summary of the paper or none. Appears at\\nthe top under the title.bibliography
: The result of a call to the bibliography function or none.\\nThe function also accepts a single, positional argument for the body of the\\npaper.appendix
: Content to append after bibliography section.accepted
: If this is set to false
then anonymized ready for submission\\ndocument is produced; accepted: true
produces camera-redy version. If\\nthe argument is set to none
then preprint version is produced (can be\\nuploaded to arXiv).review
: Hypertext link to review on OpenReview.pubdate
: Date of publication (used only month and date).The template will initialize your package with a sample call to the tmlr
\\nfunction in a show rule. If you want to change an existing project to use this\\ntemplate, you can add a show rule at the top of your file.
This template is developed at daskol/typst-templates repo. Please report\\nall issues there.
\\nWhile author instruction says the all text should be in sans serif font\\nComputer Modern Bright, only headers and titles are in sans font Computer\\nModern Sans and the rest of text is causal Computer Modern Serif (or Roman).\\nTo be precice, the original template uses Latin Modern, a descendant of\\nComputer Modern. In this tempalte we stick to CMU (Computer Modern Unicode)\\nfont family.
\\nIn the original template paper, the word Abstract is of large font size\\n(12pt) and bold. This affects slightly line spacing. We don\'t know how to\\nadjust Typst to reproduce this feature of the reference template but this\\nissue does not impact a lot on visual appearence and layouting.
\\nIn the original template special level-3 sections like \\"Author Contributions\\"\\nor \\"Acknowledgements\\" are not added to outline. We add them to outline as\\nlevel-1 header but still render them as level-3 headers.
\\nICML-like bibliography style. In this case, the bibliography slightly differs\\nfrom the one in the original example paper. The main difference is that we\\nprefer to use author\'s lastname at first place to search an entry faster.
\\nIn the original template a lot of vertical space is inserted before and after\\ngraphics and table figures. It is unclear why so much space are inserted. We\\nbelive that the reason is how Typst justify content verticaly. Nevertheless,\\nwe append a page break after \\"Default Notation\\" section in order to show that\\nspacing does not differ visually.
\\nAnother issue is related to Typst\'s inablity to produce colored annotation.\\nIn order to mitigte the issue, we add a script which modifies annotations and\\nmake them colored.
\\n../colorize-annotations.py \\\\\\n example-paper.typst.pdf example-paper-colored.typst.pdf\\n
\\nSee README.md for details.
\\nTemplate para hacer tareas, informes y trabajos, para estudiantes y académicos de la Facultad de Ciencias Físicas y Matemáticas de la Universidad de Chile que han usado templates similares para LaTeX.
\\nSi utilizas la webapp de Typst puedes presionar \\"Start from template\\" y buscar \\"minerva-report-fcfm\\" para crear un nuevo proyecto con este template.
\\nTeniendo el CLI con la versión 0.11.0 o mayor, puedes realizar:
\\ntypst init @preview/minerva-report-fcfm:0.2.1\\n
\\nEsto va a descargar el template en la cache de typst y luego va a iniciar el proyecto en la carpeta actual.
\\nLa mayoría de la configuración se realiza a través del archivo meta.typ
,\\nallí podrás elegir un título, indicar los autores, el equipo docente, entre otras configuraciones.
El campo autores
solo puede ser string
o un array
de strings.
La configuración departamento
puede ser personalizada a cualquier organización pasandole un diccionario de esta forma:
#let departamento = (\\n nombre: (\\n \\"Universidad Técnica Federico Santa María\\",\\n )\\n)\\n
\\nLas demás configuraciones pueden ser un content
arbitrario, o un string
.
Algunos aspectos más avanzados pueden ser configurados a través de la show rule que inicializa el documento #show: minerva.report.with( ... )
, los parámetros opcionales que recibe la función report
son los siguientes:
| nombre | tipo | descrición |\\n|-----------|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\\n| portada | (meta) => content | Una función que recibe el diccionario meta.typ
y retorna una página. |\\n| header | (meta) => content | Header a aplicarse a cada página. |\\n| footer | (meta) => content | Footer a aplicarse a cada página. |\\n| showrules | bool | El template aplica ciertas show-rules para que sea más fácil de utilizar. Si quires más personalización, es probable que necesites desactivarlas y luego solo utilizar las que necesites. |
El template incluye show rules que pueden ser incluidas opcionalmente.\\nTodas estas show rules pueden ser activadas agregando:
\\n#show: minerva.<nombre-función>\\n
\\nJusto después de la línea #show minerva.report.with( ... )
reemplazando <nombre-función>
\\npor el nombre de la show rule a aplicar.
Esta show rule hace que el primer heading que tenga outlined: true
se muestre en una\\nnueva página (con weak: true
). Notar que al ser weak: true
si la página ya de por\\nsi estaba vacía, no se crea otra página adicional, pero para que la página realmente\\nse considere vacía no debe contener absolutamente nada, incluso tener elementos invisibles\\nva a causar que se agregue una página extra.
Cambia los operadores matemáticos que define Typst por defecto a sus contrapartes en\\nespañol, esto es, cambia lim
por lím
, inf
por ínf
y así con todos.
Cambia los números dentro de las ecuaciones para que usen coma decimal en vez\\nde punto decimal, como es convención en el español. Esta show rule no viene\\nactiva por defecto.
\\n","description":"Template para hacer tareas, informes y trabajos, para estudiantes y académicos de la Facultad de Ciencias Físicas y Matemáticas de la Universidad de Chile que han usado templates similares para LaTeX. Guía Rápida\\nWebapp\\n\\nSi utilizas la webapp de Typst puedes presionar \\"Start from…","guid":"https://typst.app/universe/package/minerva-report-fcfm","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-29T14:10:53.779Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"classic-jmlr (0.4.0) | Paper template for submission to Journal of Machine Learning Research (JMLR)","url":"https://typst.app/universe/package/classic-jmlr","content":"This is a Typst template for Journal of Machine Learning Research (JMLR). It is\\nbased on official author guide, formatting instructions, and\\nformatting error checklist as well as the official example paper.
\\nYou can use this template in the Typst web app by clicking Start from\\ntemplate on the dashboard and searching for classic-jmlr
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/classic-jmlr\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the jmlr
function with the following named arguments.
title
: The paper\'s title as content.short-title
: Paper short title (for page header).authors
: An array of author dictionaries. Each of the author dictionaries\\nmust have a name key and can have the keys department, organization,\\nlocation, and email.last-names
: List of authors last names (for page header).keywords
: Publication keywords (used in PDF metadata).date
: Creation date (used in PDF metadata).abstract
: The content of a brief summary of the paper or none. Appears at\\nthe top under the title.bibliography
: The result of a call to the bibliography function or none.\\nThe function also accepts a single, positional argument for the body of the\\npaper.appendix
: Content to append after bibliography section.pubdata
: Dictionary with auxiliary information about publication. It\\ncontains editor name(s), paper id, volume, and submission/review/publishing\\ndates.The template will initialize your package with a sample call to the jmlr
\\nfunction in a show rule. If you want to change an existing project to use this\\ntemplate, you can add a show rule at the top of your file.
#import \\"@preview/classic-jmlr\\": jmlr\\n#show: jmlr.with(\\n title: [Sample JMLR Paper],\\n authors: (authors, affls),\\n abstract: blindtext,\\n keywords: (\\"keyword one\\", \\"keyword two\\", \\"keyword three\\"),\\n bibliography: bibliography(\\"main.bib\\"),\\n appendix: include \\"appendix.typ\\",\\n pubdata: (\\n id: \\"21-0000\\",\\n editor: \\"My editor\\",\\n volume: 23,\\n submitted-at: datetime(year: 2021, month: 1, day: 1),\\n revised-at: datetime(year: 2022, month: 5, day: 1),\\n published-at: datetime(year: 2022, month: 9, day: 1),\\n ),\\n)\\n
\\nThis template is developed at daskol/typst-templates repo. Please report\\nall issues there.
\\nOriginal JMLR example paper is not not representative. It does not\\ndemonstrate appearance of figures, images, tables, lists, etc.
\\nLeading in author affilations in in the original template is varying.
\\nThere is no bibliography CSL-style. The closest one is\\nbristol-university-press
.
Another issue is related to Typst\'s inablity to produce colored annotation.\\nIn order to mitigte the issue, we add a script which modifies annotations and\\nmake them colored.
\\n../colorize-annotations.py \\\\\\n example-paper.typst.pdf example-paper-colored.typst.pdf\\n
\\nSee README.md for details.
\\n\\n\\nPesha (Urdu: پیشہ) is the Urdu term for occupation/profession. It is pronounced as pay-sha.
\\n
A clean and minimal template for your CV or résumé.
\\nThis template is inspired by Matthew Butterick\'s excellent\\nPractical Typography book.
\\nSee example.pdf or example-profile-picture.pdf file to see\\nhow it looks.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the\\ndashboard and searching for pesha
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/pesha\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the pesha
function with the following named arguments:
| Argument | Type | Description |\\n| --- | --- | --- |\\n| name
| string | A string to specify the author\'s name. |\\n| address
| string | A string to specify the author\'s address. |\\n| contacts
| array | An array of content to specify your contact information. E.g., phone number, email, LinkedIn, etc. |\\n| profile-picture
| content | The result of a call to the image function or none
. For best result, make sure that your image has an 1:1 aspect ratio. |\\n| paper-size
| string | Specify a paper size string to change the page size (default is a4
). |\\n| footer-text
| content | Content that will be prepended to the page numbering in the footer. |\\n| page-numbering-format
| string | Pattern that will be used for displaying page numbering in the footer (default is 1 of 1
). |
The function also accepts a single, positional argument for the body.
\\nThe template will initialize your package with a sample call to the pesha
function in a\\nshow rule. If you, however, want to change an existing project to use this template, you\\ncan add a show rule like this at the top of your file:
#import \\"@preview/pesha:0.4.0\\": *\\n\\n#show: pesha.with(\\n name: \\"Max Mustermann\\",\\n address: \\"5419 Hollywood Blvd Ste c731, Los Angeles, CA 90027\\",\\n contacts: (\\n [(323) 555 1435],\\n [#link(\\"mailto:max@mustermann.com\\")],\\n ),\\n paper-size: \\"us-letter\\",\\n footer-text: [Mustermann Résumé ---]\\n)\\n\\n// Your content goes below.\\n
\\n","description":"Pesha (Urdu: پیشہ) is the Urdu term for occupation/profession. It is pronounced as pay-sha. A clean and minimal template for your CV or résumé.\\n\\nThis template is inspired by Matthew Butterick\'s excellent Practical Typography book.\\n\\nSee example.pdf or example-profile-picture.pdf…","guid":"https://typst.app/universe/package/pesha","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-19T15:14:22.539Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"problemst (0.1.0) | Simple and easy-to-use template for problem sets/homeworks/assignments.","url":"https://typst.app/universe/package/problemst","content":"Simple and easy-to-use template for problem sets/homeworks/assignments.
\\nClick \\"Start from template\\" in the Typst web app and search for problemst
.
Alternatively, run the following command to create a directory initialized with all necessary files:
\\ntypst init @preview/problemst:0.1.0\\n
\\nThe pset
function takes the following named arguments:
class
(string): Class the assignment is for.student
(string): Student completing the assignment.title
(string): Title of the assignment.date
(datetime): Date to be displayed on the assignment.collaborators
(array of strings): Collaborators that worked on the assignment with the student. Can be ()
.subproblems
(string): Numbering scheme for the subproblems.Powerful, Simple, Concise
\\nA Typst plugin for turning data into tables.
\\nThe tabut
function takes input in “record” format, an array of\\ndictionaries, with each dictionary representing a single “object” or\\n“record”.
In the example below, each record is a listing for an office supply\\nproduct.
\\n#let supplies = (\\n (name: \\"Notebook\\", price: 3.49, quantity: 5),\\n (name: \\"Ballpoint Pens\\", price: 5.99, quantity: 2),\\n (name: \\"Printer Paper\\", price: 6.99, quantity: 3),\\n)\\n
\\nNow create a basic table from the data.
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies, // the source of the data used to generate the table\\n ( // column definitions\\n (\\n header: [Name], // label, takes content.\\n func: r => r.name // generates the cell content.\\n ), \\n (header: [Price], func: r => r.price), \\n (header: [Quantity], func: r => r.quantity), \\n )\\n)\\n
\\nfunct
takes a function which generates content for a given cell\\ncorrosponding to the defined column for each record. r
is the record,\\nso r => r.name
returns the name
property of each record in the input\\ndata if it has one.
The philosphy of tabut
is that the display of data should be simple\\nand clearly defined, therefore each column and it’s content and\\nformatting should be defined within a single clear column defintion. One\\nconsequence is you can comment out, remove or move, any column easily,\\nfor example:
#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n (\\n (header: [Price], func: r => r.price), // This column is moved to the front\\n (header: [Name], func: r => r.name), \\n (header: [Name 2], func: r => r.name), // copied\\n // (header: [Quantity], func: r => r.quantity), // removed via comment\\n )\\n)\\n
\\nAny default Table style options can be tacked on and are passed to the\\nfinal table function.
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n ( \\n (header: [Name], func: r => r.name), \\n (header: [Price], func: r => r.price), \\n (header: [Quantity], func: r => r.quantity),\\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\nYou can pass any content or expression into the header property.
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#let fmt(it) = {\\n heading(\\n outlined: false,\\n upper(it)\\n )\\n}\\n\\n#tabut(\\n supplies,\\n ( \\n (header: fmt([Name]), func: r => r.name ), \\n (header: fmt([Price]), func: r => r.price), \\n (header: fmt([Quantity]), func: r => r.quantity), \\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\nYou can prevent from being generated with the headers
paramater. This\\nis useful with the tabut-cells
function as demonstrated in it’s\\nsection.
#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n (\\n (header: [*Name*], func: r => r.name), \\n (header: [*Price*], func: r => r.price), \\n (header: [*Quantity*], func: r => r.quantity), \\n ),\\n headers: false, // Prevents Headers from being generated\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none,\\n)\\n
\\nJust like the headers, cell contents can be modified and formatted like\\nany content in Typst.
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n ( \\n (header: [*Name*], func: r => r.name ), \\n (header: [*Price*], func: r => usd(r.price)), \\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\nYou can have the cell content function do calculations on a record\\nproperty.
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n ( \\n (header: [*Name*], func: r => r.name ), \\n (header: [*Price*], func: r => usd(r.price)), \\n (header: [*Tax*], func: r => usd(r.price * .2)), \\n (header: [*Total*], func: r => usd(r.price * 1.2)), \\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\nOr even combine multiple record properties, go wild.
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n\\n#let employees = (\\n (id: 3251, first: \\"Alice\\", last: \\"Smith\\", middle: \\"Jane\\"),\\n (id: 4872, first: \\"Carlos\\", last: \\"Garcia\\", middle: \\"Luis\\"),\\n (id: 5639, first: \\"Evelyn\\", last: \\"Chen\\", middle: \\"Ming\\")\\n);\\n\\n#tabut(\\n employees,\\n ( \\n (header: [*ID*], func: r => r.id ),\\n (header: [*Full Name*], func: r => [#r.first #r.middle.first(), #r.last] ),\\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\ntabut
automatically adds an _index
property to each record.
#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n ( \\n (header: [*\\\\#*], func: r => r._index),\\n (header: [*Name*], func: r => r.name ), \\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\nYou can also prevent the index
property being generated by setting it\\nto none
, or you can also set an alternate name of the index property\\nas shown below.
#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n ( \\n (header: [*\\\\#*], func: r => r.index-alt ),\\n (header: [*Name*], func: r => r.name ), \\n ),\\n index: \\"index-alt\\", // set an aternate name for the automatically generated index property.\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\nThis was annoying to implement, and I don’t know when you’d actually use\\nthis, but here.
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n (\\n (header: [*\\\\#*], func: r => r._index),\\n (header: [*Name*], func: r => r.name), \\n (header: [*Price*], func: r => usd(r.price)), \\n (header: [*Quantity*], func: r => r.quantity),\\n ),\\n transpose: true, // set optional name arg `transpose` to `true`\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n ( // Include `align` as an optional arg to a column def\\n (header: [*\\\\#*], func: r => r._index),\\n (header: [*Name*], align: right, func: r => r.name), \\n (header: [*Price*], align: right, func: r => usd(r.price)), \\n (header: [*Quantity*], align: right, func: r => r.quantity),\\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\nYou can also define Alignment manually as in the the standard Table\\nFunction.
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut(\\n supplies,\\n ( \\n (header: [*\\\\#*], func: r => r._index),\\n (header: [*Name*], func: r => r.name), \\n (header: [*Price*], func: r => usd(r.price)), \\n (header: [*Quantity*], func: r => r.quantity),\\n ),\\n align: (auto, right, right, right), // Alignment defined as in standard table function\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#box(\\n width: 300pt,\\n tabut(\\n supplies,\\n ( // Include `width` as an optional arg to a column def\\n (header: [*\\\\#*], func: r => r._index),\\n (header: [*Name*], width: 1fr, func: r => r.name), \\n (header: [*Price*], width: 20%, func: r => usd(r.price)), \\n (header: [*Quantity*], width: 1.5in, func: r => r.quantity),\\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none,\\n )\\n)\\n\\n
\\nYou can also define Columns manually as in the the standard Table\\nFunction.
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#box(\\n width: 300pt,\\n tabut(\\n supplies,\\n (\\n (header: [*\\\\#*], func: r => r._index),\\n (header: [*Name*], func: r => r.name), \\n (header: [*Price*], func: r => usd(r.price)), \\n (header: [*Quantity*], func: r => r.quantity),\\n ),\\n columns: (auto, 1fr, 20%, 1.5in), // Columns defined as in standard table\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none,\\n )\\n)\\n\\n
\\n#import \\"@preview/tabut:1.0.2\\": tabut-cells\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#tabut-cells(\\n supplies,\\n ( \\n (header: [Name], func: r => r.name), \\n (header: [Price], func: r => usd(r.price)), \\n (header: [Quantity], func: r => r.quantity),\\n )\\n)\\n
\\n#import \\"@preview/tabut:1.0.2\\": tabut-cells\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#import \\"@preview/tablex:0.0.8\\": tablex, rowspanx, colspanx\\n\\n#tablex(\\n auto-vlines: false,\\n header-rows: 2,\\n\\n /* --- header --- */\\n rowspanx(2)[*Name*], colspanx(2)[*Price*], (), rowspanx(2)[*Quantity*],\\n (), [*Base*], [*W/Tax*], (),\\n /* -------------- */\\n\\n ..tabut-cells(\\n supplies,\\n ( \\n (header: [], func: r => r.name), \\n (header: [], func: r => usd(r.price)), \\n (header: [], func: r => usd(r.price * 1.3)), \\n (header: [], func: r => r.quantity),\\n ),\\n headers: false\\n )\\n)\\n
\\nWhile technically seperate from table display, the following are\\nexamples of how to perform operations on data before it is displayed\\nwith tabut
.
Since tabut
assumes an “array of dictionaries” format, then most data\\noperations can be performed easily with Typst’s native array functions.\\ntabut
also provides several functions to provide additional\\nfunctionality.
By default, imported CSV gives a “rows” or “array of arrays” data\\nformat, which can not be directly used by tabut
. To convert, tabut
\\nincludes a function rows-to-records
demonstrated below.
#import \\"@preview/tabut:1.0.2\\": tabut, rows-to-records\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#let titanic = {\\n let titanic-raw = csv(\\"example-data/titanic.csv\\");\\n rows-to-records(\\n titanic-raw.first(), // The header row\\n titanic-raw.slice(1, -1), // The rest of the rows\\n )\\n}\\n
\\nImported CSV data are all strings, so it’s usefull to convert them to\\nint
or float
when possible.
#import \\"@preview/tabut:1.0.2\\": tabut, rows-to-records\\n#import \\"example-data/supplies.typ\\": supplies\\n\\n#let auto-type(input) = {\\n let is-int = (input.match(regex(\\"^-?\\\\d+$\\")) != none);\\n if is-int { return int(input); }\\n let is-float = (input.match(regex(\\"^-?(inf|nan|\\\\d+|\\\\d*(\\\\.\\\\d+))$\\")) != none);\\n if is-float { return float(input) }\\n input\\n}\\n\\n#let titanic = {\\n let titanic-raw = csv(\\"example-data/titanic.csv\\");\\n rows-to-records( titanic-raw.first(), titanic-raw.slice(1, -1) )\\n .map( r => {\\n let new-record = (:);\\n for (k, v) in r.pairs() { new-record.insert(k, auto-type(v)); }\\n new-record\\n })\\n}\\n
\\ntabut
includes a function, records-from-csv
, to automatically\\nperform this process.
#import \\"@preview/tabut:1.0.2\\": records-from-csv\\n\\n#let titanic = records-from-csv(csv(\\"example-data/titanic.csv\\"));\\n
\\n#import \\"@preview/tabut:1.0.2\\": tabut, records-from-csv\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/titanic.typ\\": titanic\\n\\n#let classes = (\\n \\"N/A\\",\\n \\"First\\", \\n \\"Second\\", \\n \\"Third\\"\\n);\\n\\n#let titanic-head = titanic.slice(0, 5);\\n\\n#tabut(\\n titanic-head,\\n ( \\n (header: [*Name*], func: r => r.Name), \\n (header: [*Class*], func: r => classes.at(r.Pclass)),\\n (header: [*Fare*], func: r => usd(r.Fare)), \\n (header: [*Survived?*], func: r => (\\"No\\", \\"Yes\\").at(r.Survived)), \\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/titanic.typ\\": titanic, classes\\n\\n#tabut(\\n titanic\\n .sorted(key: r => r.Fare)\\n .rev()\\n .slice(0, 5),\\n ( \\n (header: [*Name*], func: r => r.Name), \\n (header: [*Class*], func: r => classes.at(r.Pclass)),\\n (header: [*Fare*], func: r => usd(r.Fare)), \\n (header: [*Survived?*], func: r => (\\"No\\", \\"Yes\\").at(r.Survived)), \\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\n#import \\"@preview/tabut:1.0.2\\": tabut\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/titanic.typ\\": titanic, classes\\n\\n#tabut(\\n titanic\\n .filter(r => r.Pclass == 1)\\n .slice(0, 5),\\n ( \\n (header: [*Name*], func: r => r.Name), \\n (header: [*Class*], func: r => classes.at(r.Pclass)),\\n (header: [*Fare*], func: r => usd(r.Fare)), \\n (header: [*Survived?*], func: r => (\\"No\\", \\"Yes\\").at(r.Survived)), \\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/titanic.typ\\": titanic, classes\\n\\n#table(\\n columns: (auto, auto),\\n [*Fare, Total:*], [#usd(titanic.map(r => r.Fare).sum())],\\n [*Fare, Avg:*], [#usd(titanic.map(r => r.Fare).sum() / titanic.len())], \\n stroke: none\\n)\\n
\\n#import \\"@preview/tabut:1.0.2\\": tabut, group\\n#import \\"example-data/titanic.typ\\": titanic, classes\\n\\n#tabut(\\n group(titanic, r => r.Pclass),\\n (\\n (header: [*Class*], func: r => classes.at(r.value)), \\n (header: [*Passengers*], func: r => r.group.len()), \\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\n#import \\"@preview/tabut:1.0.2\\": tabut, group\\n#import \\"usd.typ\\": usd\\n#import \\"example-data/titanic.typ\\": titanic, classes\\n\\n#tabut(\\n group(titanic, r => r.Pclass),\\n (\\n (header: [*Class*], func: r => classes.at(r.value)), \\n (header: [*Total Fare*], func: r => usd(r.group.map(r => r.Fare).sum())), \\n (\\n header: [*Avg Fare*], \\n func: r => usd(r.group.map(r => r.Fare).sum() / r.group.len())\\n ), \\n ),\\n fill: (_, row) => if calc.odd(row) { luma(240) } else { luma(220) }, \\n stroke: none\\n)\\n
\\ntabut
Takes data and column definitions and outputs a table.
\\ntabut(\\n data-raw, \\n colDefs, \\n columns: auto,\\n align: auto,\\n index: \\"_index\\",\\n transpose: false,\\n headers: true,\\n ..tableArgs\\n) -> content\\n
\\ndata-raw
\\nThis is the raw data that will be used to generate the table. The data\\nis expected to be in an array of dictionaries, where each dictionary\\nrepresents a single record or object.
colDefs
\\nThese are the column definitions. An array of dictionaries, each\\nrepresenting column definition. Must include the properties header
and\\na func
. header
expects content, and specifies the label of the\\ncolumn. func
expects a function, the function takes a record\\ndictionary as input and returns the value to be displayed in the cell\\ncorresponding to that record and column. There are also two optional\\nproperties; align
sets the alignment of the content within the cells\\nof the column, width
sets the width of the column.
columns
\\n(optional, default: auto
) Specifies the column widths. If set to\\nauto
, the function automatically generates column widths by each\\ncolumn’s column definition. Otherwise functions exactly the columns
\\nparamater of the standard Typst table
function. Unlike the\\ntabut-cells
setting this to none
will break.
align
\\n(optional, default: auto
) Specifies the column alignment. If set to\\nauto
, the function automatically generates column alignment by each\\ncolumn’s column definition. If set to none
no align
property is\\nadded to the output arg. Otherwise functions exactly the align
\\nparamater of the standard Typst table
function.
index
\\n(optional, default: \\"_index\\"
) Specifies the property name for the\\nindex of each record. By default, an _index
property is automatically\\nadded to each record. If set to none
, no index property is added.
transpose
\\n(optional, default: false
) If set to true
, transposes the table,\\nswapping rows and columns.
headers
\\n(optional, default: true
) Determines whether headers should be\\nincluded in the output. If set to false
, headers are not generated.
tableArgs
\\n(optional) Any additional arguments are passed to the table
function,\\ncan be used for styling or anything else.
tabut-cells
The tabut-cells
function functions as tabut
, but returns arguments
\\nfor use in either the standard table
function or other tools such as\\ntablex
. If you just want the array of cells, use the pos
function on\\nthe returned value, ex tabut-cells(...).pos
.
tabut-cells
is particularly useful when you need to generate only the\\ncell contents of a table or when these cells need to be passed to\\nanother function for further processing or customization.
tabut-cells(\\n data-raw, \\n colDefs, \\n columns: auto,\\n align: auto,\\n index: \\"_index\\",\\n transpose: false,\\n headers: true,\\n) -> arguments\\n
\\ndata-raw
\\nThis is the raw data that will be used to generate the table. The data\\nis expected to be in an array of dictionaries, where each dictionary\\nrepresents a single record or object.
colDefs
\\nThese are the column definitions. An array of dictionaries, each\\nrepresenting column definition. Must include the properties header
and\\na func
. header
expects content, and specifies the label of the\\ncolumn. func
expects a function, the function takes a record\\ndictionary as input and returns the value to be displayed in the cell\\ncorresponding to that record and column. There are also two optional\\nproperties; align
sets the alignment of the content within the cells\\nof the column, width
sets the width of the column.
columns
\\n(optional, default: auto
) Specifies the column widths. If set to\\nauto
, the function automatically generates column widths by each\\ncolumn’s column definition. If set to none
no column
property is\\nadded to the output arg. Otherwise functions exactly the columns
\\nparamater of the standard typst table
function.
align
\\n(optional, default: auto
) Specifies the column alignment. If set to\\nauto
, the function automatically generates column alignment by each\\ncolumn’s column definition. If set to none
no align
property is\\nadded to the output arg. Otherwise functions exactly the align
\\nparamater of the standard typst table
function.
index
\\n(optional, default: \\"_index\\"
) Specifies the property name for the\\nindex of each record. By default, an _index
property is automatically\\nadded to each record. If set to none
, no index property is added.
transpose
\\n(optional, default: false
) If set to true
, transposes the table,\\nswapping rows and columns.
headers
\\n(optional, default: true
) Determines whether headers should be\\nincluded in the output. If set to false
, headers are not generated.
records-from-csv
Automatically converts a CSV data into an array of records.
\\nrecords-from-csv(\\n data\\n) -> array\\n
\\ndata
\\nThe CSV data that needs to be converted, this can be obtained using the\\nnative csv
function, like records-from-csv(csv(file-path))
.
This function simplifies the process of converting CSV data into a\\nformat compatible with tabut
. It reads the CSV data, extracts the\\nheaders, and converts each row into a dictionary, using the headers as\\nkeys.
It also automatically converts data into floats or integers when\\npossible.
\\nrows-to-records
Converts rows of data into an array of records based on specified\\nheaders.
\\nThis function is useful for converting data in a “rows” format (commonly\\nfound in CSV files) into an array of dictionaries format, which is\\nrequired for tabut
and allows easy data processing using the built in\\narray functions.
rows-to-records(\\n headers, \\n rows, \\n default: none\\n) -> array\\n
\\nheaders
\\nAn array representing the headers of the table. Each item in this array\\ncorresponds to a column header.
rows
\\nAn array of arrays, each representing a row of data. Each sub-array\\ncontains the cell data for a corresponding row.
default
\\n(optional, default: none
) A default value to use when a cell is empty\\nor there is an error.
group
Groups data based on a specified function and returns an array of\\ngrouped records.
\\ngroup(\\n data, \\n function\\n) -> array\\n
\\ndata
\\nAn array of dictionaries. Each dictionary represents a single record or\\nobject.
function
\\nA function that takes a record as input and returns a value based on\\nwhich the grouping is to be performed.
This function iterates over each record in the data
, applies the\\nfunction
to determine the grouping value, and organizes the records\\ninto groups based on this value. Each group record is represented as a\\ndictionary with two properties: value
(the result of the grouping\\nfunction) and group
(an array of records belonging to this group).
In the context of tabut
, the group
function is particularly useful\\nfor creating summary tables where records need to be categorized and\\naggregated based on certain criteria, such as calculating total or\\naverage values for each group.
A Typst package for typesetting proof trees.
\\nYou can import the latest version of this package with:
\\n#import \\"@preview/curryst:0.3.0\\": rule, proof-tree\\n
\\nTo display a proof tree, you first need to create a tree, using the rule
function. Its first argument is the conclusion, and the other positional arguments are the premises. It also accepts a name
for the rule name, displayed on the right of the bar, as well as a label
, displayed on the left of the bar.
#let tree = rule(\\n label: [Label],\\n name: [Rule name],\\n [Conclusion],\\n [Premise 1],\\n [Premise 2],\\n [Premise 3]\\n)\\n
\\nThen, you can display the tree with the proof-tree
function:
#proof-tree(tree)\\n
\\nIn this case, we get the following result:
\\nProof trees can be part of mathematical formulas:
\\nConsider the following tree:\\n$\\n Pi quad = quad #proof-tree(\\n rule(\\n $phi$,\\n $Pi_1$,\\n $Pi_2$,\\n )\\n )\\n$\\n$Pi$ constitutes a derivation of $phi$.s\\n
\\nYou can specify a rule as the premises of a rule in order to create a tree:
\\n#proof-tree(\\n rule(\\n name: $R$,\\n $C_1 or C_2 or C_3$,\\n rule(\\n name: $A$,\\n $C_1 or C_2 or L$,\\n rule(\\n $C_1 or L$,\\n $Pi_1$,\\n ),\\n ),\\n rule(\\n $C_2 or overline(L)$,\\n $Pi_2$,\\n ),\\n )\\n)\\n
\\nAs an example, here is a natural deduction proof tree generated with Curryst:
\\n#let ax = rule.with(name: [ax])\\n#let and-el = rule.with(name: $and_e^ell$)\\n#let and-er = rule.with(name: $and_e^r$)\\n#let impl-i = rule.with(name: $scripts(->)_i$)\\n#let impl-e = rule.with(name: $scripts(->)_e$)\\n#let not-i = rule.with(name: $not_i$)\\n#let not-e = rule.with(name: $not_e$)\\n\\n#proof-tree(\\n impl-i(\\n $tack (p -> q) -> not (p and not q)$,\\n not-i(\\n $p -> q tack not (p and not q)$,\\n not-e(\\n $ underbrace(p -> q\\\\, p and not q, Gamma) tack bot $,\\n impl-e(\\n $Gamma tack q$,\\n ax($Gamma tack p -> q$),\\n and-el(\\n $Gamma tack p$,\\n ax($Gamma tack p and not q$),\\n ),\\n ),\\n and-er(\\n $Gamma tack not q$,\\n ax($Gamma tack p and not q$),\\n ),\\n ),\\n ),\\n )\\n)\\n
\\nThe proof-tree
function accepts multiple named arguments that let you customize the tree:
prem-min-spacing
title-inset
stroke
horizontal-spacing
min-bar-height
For more information, please refer to the documentation in curryst.typ
.
Suiji (随机 in Chinese, /suíjī/, meaning random) is a high efficient random number generator in Typst. Partial algorithm is inherited from GSL and most APIs are similar to NumPy Random Generator. It provides pure function implementation and does not rely on any global state variables, resulting in better performance and independency.
\\nThe example below uses suiji
and cetz
packages to create a trajectory of a random walk.
#import \\"@preview/suiji:0.3.0\\": *\\n#import \\"@preview/cetz:0.2.2\\"\\n\\n#set page(width: auto, height: auto, margin: 0.5cm)\\n\\n#cetz.canvas(length: 5pt, {\\n import cetz.draw: *\\n\\n let n = 2000\\n let (x, y) = (0, 0)\\n let (x-new, y-new) = (0, 0)\\n let rng = gen-rng(42)\\n let v = ()\\n\\n for i in range(n) {\\n (rng, v) = uniform(rng, low: -2.0, high: 2.0, size: 2)\\n (x-new, y-new) = (x - v.at(1), y - v.at(0))\\n let col = color.mix((blue.transparentize(20%), 1-i/n), (green.transparentize(20%), i/n))\\n line(stroke: (paint: col, cap: \\"round\\", thickness: 2pt),\\n (x, y), (x-new, y-new)\\n )\\n (x, y) = (x-new, y-new)\\n }\\n})\\n
\\nAnother example is drawing the the famous Matrix rain effect of falling green characters in a terminal.
\\n#import \\"@preview/suiji:0.3.0\\": *\\n#import \\"@preview/cetz:0.2.2\\"\\n\\n#set page(width: auto, height: auto, margin: 0pt)\\n\\n#cetz.canvas(length: 1pt, {\\n import cetz.draw: *\\n\\n let font-size = 10\\n let num-col = 80\\n let num-row = 32\\n let text-len = 16\\n let seq = \\"abcdefghijklmnopqrstuvwxyz!@#$%^&*\\".split(\\"\\").slice(1, 35).map(it => raw(it))\\n let rng = gen-rng(42)\\n let num-cnt = 0\\n let val = 0\\n let chars = ()\\n\\n rect((-10, -10), (font-size * (num-col - 1) * 0.6 + 10, font-size * (num-row - 1) + 10), fill: black)\\n\\n for c in range(num-col) {\\n (rng, num-cnt) = integers(rng, low: 1, high: 3)\\n for cnt in range(num-cnt) {\\n (rng, val) = integers(rng, low: -10, high: num-row - 2)\\n (rng, chars) = choice(rng, seq, size: text-len)\\n for i in range(text-len) {\\n let y = i + val\\n if y >= 0 and y < num-row {\\n let col = green.transparentize((i / text-len) * 100%)\\n content(\\n (c * font-size * 0.6, y * font-size),\\n text(size: font-size * 1pt, fill:col, stroke: (text-len - i) * 0.04pt + col, chars.at(i))\\n )\\n }\\n }\\n }\\n }\\n})\\n
\\nImport suiji
module first before use any random functions from it.
#import \\"@preview/suiji:0.3.0\\": *\\n
\\nFor functions that generate various random numbers or randomly shuffle, a random number generator object (rng) is required as both input and output arguments. And the original rng should be created by function gen-rng
, with an integer as the argument of seed. This calling style seems to be a little inconvenient, as it is limited by the programming paradigm. For function discrete
, the given probalilities of the discrete events should be preprocessed by function discrete-preproc
, whose output serves as an input argument of discrete
.
Another set of functions with the same functionality provides higher performance (about 3 times faster) and has the suffix -f
in their names. For example, gen-rng-f
and integers-f
are the fast versions of gen-rng
and integers
, respectively.
The function rand-sc
creates blind text of Simplified Chinese. This function yields a Chinese-like Lorem Ipsum blind text with the given number of words, where punctuations are optional.
The code below generates several random permutations of 0 to 9. Each time after function shuffle-f
is called, the value of variable rng
is updated, so generated permutations are different.
#{\\n let rng = gen-rng-f(42)\\n let a = ()\\n for i in range(5) {\\n (rng, a) = shuffle-f(rng, range(10))\\n [#(a.map(it => str(it)).join(\\" \\")) \\\\ ]\\n }\\n}\\n
\\nFor more codes with these functions see tests.
\\ngen-rng
/ gen-rng-f
Construct a new random number generator with a seed.
\\n#let gen-rng(seed) = {...}\\n
\\nInput Arguments
\\nseed
: [int
] value of seed.Output Arguments
\\nrng
: [object
] generated object of random number generator.randi-f
Return a raw random integer from [0, 2^31).
\\n#let randi-f(rng) = {...}\\n
\\nInput Arguments
\\nrng
: [object
| int
] object of random number generator (generated by function *-f
).Output Arguments
\\nrng-out
: [object
| int
] updated object of random number generator (random integer from the interval [0, 2^31-1]).integers
/ integers-f
Return random integers from low
(inclusive) to high
(exclusive).
#let integers(rng, low: 0, high: 100, size: none, endpoint: false) = {...}\\n
\\nInput Arguments
\\nrng
: [object
] object of random number generator.low
: [int
] lowest (signed) integers to be drawn from the distribution, optional.high
: [int
] one above the largest (signed) integer to be drawn from the distribution, optional.size
: [none
or int
] returned array size, must be none or non-negative integer, optional.endpoint
: [bool
] if true, sample from the interval [low
, high
] instead of the default [low
, high
), optional.Output Arguments
\\narray
] : (rng-out
, arr-out
)\\nrng-out
: [object
] updated object of random number generator.arr-out
: [int
| array
of int
] array of random numbers.random
/ random-f
Return random floats in the half-open interval [0.0, 1.0).
\\n#let random(rng, size: none) = {...}\\n
\\nInput Arguments
\\nrng
: [object
] object of random number generator.size
: [none
or int
] returned array size, must be none or non-negative integer, optional.Output Arguments
\\narray
] : (rng-out
, arr-out
)\\nrng-out
: [object
] updated object of random number generator.arr-out
: [float
| array
of float
] array of random numbers.uniform
/ uniform-f
Draw samples from a uniform distribution. Samples are uniformly distributed over the half-open interval [low
, high
) (includes low
, but excludes high
).
#let uniform(rng, low: 0.0, high: 1.0, size: none) = {...}\\n
\\nInput Arguments
\\nrng
: [object
] object of random number generator.low
: [float
] lower boundary of the output interval, optional.high
: [float
] upper boundary of the output interval, optional.size
: [none
or int
] returned array size, must be none or non-negative integer, optional.Output Arguments
\\narray
] : (rng-out
, arr-out
)\\nrng-out
: [object
] updated object of random number generator.arr-out
: [float
| array
of float
] array of random numbers.normal
/ normal-f
Draw random samples from a normal (Gaussian) distribution.
\\n#let normal(rng, loc: 0.0, scale: 1.0, size: none) = {...}\\n
\\nInput Arguments
\\nrng
: [object
] object of random number generator.loc
: [float
] mean (centre) of the distribution, optional.scale
: [float
] standard deviation (spread or width) of the distribution, must be non-negative, optional.size
: [none
or int
] returned array size, must be none or non-negative integer, optional.Output Arguments
\\narray
] : (rng-out
, arr-out
)\\nrng-out
: [object
] updated object of random number generator.arr-out
: [float
| array
of float
] array of random numbers.discrete-preproc
and discrete
/ discrete-preproc-f
and discrete-f
Return random indices from the given probalilities of the discrete events.
\\n#let discrete-preproc(p) = {...}\\n
\\nInput Arguments
\\np
: [array
of int
or float
] the array of probalilities of the discrete events, probalilities must be non-negative.Output Arguments
\\ng
: [object
] generated object that contains the lookup table.#let discrete(rng, g, size: none) = {...}\\n
\\nInput Arguments
\\nrng
: [object
] object of random number generator.g
: [object
] generated object that contains the lookup table by discrete-preproc
function.size
: [none
or int
] returned array size, must be none or non-negative integer, optional.Output Arguments
\\narray
] : (rng-out
, arr-out
)\\nrng-out
: [object
] updated object of random number generator.arr-out
: [int
| array
of int
] array of random indices.shuffle
/ shuffle-f
Randomly shuffle a given array.
\\n#let shuffle(rng, arr) = {...}\\n
\\nInput Arguments
\\nrng
: [object
] object of random number generator.arr
: [array
] the array to be shuffled.Output Arguments
\\narray
] : (rng-out
, arr-out
)\\nrng-out
: [object
] updated object of random number generator.arr-out
: [array
] shuffled array.choice
/ choice-f
Generate random samples from a given array.
\\n#let choice(rng, arr, size: none, replacement: true, permutation: true) = {...}\\n
\\nInput Arguments
\\nrng
: [object
] object of random number generator.arr
: [array
] the array to be sampled.size
: [none
or int
] returned array size, must be none or non-negative integer, optional.replacement
: [bool
] whether the sample is with or without replacement, optional; default is true, meaning that a value of arr
can be selected multiple times.permutation
: [bool
] whether the sample is permuted when sampling without replacement, optional; default is true, false provides a speedup.Output Arguments
\\narray
] : (rng-out
, arr-out
)\\nrng-out
: [object
] updated object of random number generator.arr-out
: [array
] generated random samples.rand-sc
Generate blind text of Simplified Chinese.
\\n#let rand-sc(words, seed: 42, punctuation: false, gap: 10) = {...}\\n
\\nInput Arguments
\\nwords
: [int
] the length of the blind text in pure words.seed
: [int
] value of seed, optional.punctuation
: [bool
] if true, insert punctuations in generated words, optional.gap
: [int
] average gap between punctuations, optional.Output Arguments
\\nstr
] : generated blind text of Simplified Chinese.= Modern Technique Report
\\nA template support modern technique report in Typst.
\\n= Usage
\\n#import \\"@preview/modern-technique-report:0.1.0\\": *\\n\\n#show: modern-technique-report.with(\\n title: [Project Name \\\\ Multiline When too Long],\\n subtitle: [\\n *Fourth Edition*, \\\\ by _H.L. Royden_ and _P.M. Fitzpatrick_\\n ],\\n series: [Mathematics Courses \\\\ Framework Series],\\n author: grid(\\n align: left + horizon,\\n columns: 3,\\n inset: 7pt,\\n [*Member*], [B. Alice], [qwertyuiop\\\\@youremail.com],\\n [], [B. Alice], [qwertyuiop\\\\@youremail.com],\\n [], [B. Alice], [qwertyuiop\\\\@youremail.com],\\n [*Advisor*], [E. Eric], [qwertyuiop\\\\@youremail.com],\\n ),\\n date: datetime.today().display(\\"[year] -- [month] -- [day]\\"),\\n background: image(\\"bg.jpg\\"),\\n theme_color: rgb(21, 74, 135),\\n font: \\"New Computer Modern\\",\\n title_font: \\"Noto Sans\\",\\n)\\n
\\nThen a cover page and a content page will be automatically generated. Template also manipulates the style of headings and some contents.
\\n","description":"= Modern Technique Report A template support modern technique report in Typst.\\n\\n= Usage\\n\\n#import \\"@preview/modern-technique-report:0.1.0\\": *\\n\\n#show: modern-technique-report.with(\\n title: [Project Name \\\\ Multiline When too Long],\\n subtitle: [\\n *Fourth Edition*, \\\\ by _H.L…","guid":"https://typst.app/universe/package/modern-technique-report","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-16T09:00:38.848Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"treet (0.1.1) | Create tree lists easily","url":"https://typst.app/universe/package/treet","content":"Create tree list easily in Typst
\\ncontribution is welcomed!
\\n#import \\"@preview/treet:0.1.1\\": *\\n\\n#tree-list(\\n marker: content,\\n last-marker: content,\\n indent: content,\\n empty-indent: content,\\n marker-font: string,\\n content,\\n)\\n
\\nmarker
- the marker of the tree list, default is [├─ ]
last-marker
- the marker of the last item of the tree list, default is [└─ ]
indent
- the indent after marker
, default is [│#h(1em)]
empty-indent
- the indent after last-marker
, default is [#h(1.5em)]
(same width as indent)marker-font
- the font of the marker, default is \\"Cascadia Code\\"
content
- the content of the tree list, includes at least a list#tree-list[\\n - 1\\n - 1.1\\n - 1.1.1\\n - 1.2\\n - 1.2.1\\n - 1.2.2\\n - 1.2.2.1\\n - 2\\n - 3\\n - 3.1\\n - 3.1.1\\n - 3.2\\n]\\n
\\n#text(red, tree-list(\\n marker: text(blue)[├── ],\\n last-marker: text(aqua)[└── ],\\n indent: text(teal)[│#h(1.5em)],\\n empty-indent: h(2em),\\n)[\\n - 1\\n - 1.1\\n - 1.1.1\\n - 1.2\\n - 1.2.1\\n - 1.2.2\\n - 1.2.2.1\\n - 2\\n - 3\\n - 3.1\\n - 3.1.1\\n - 3.2\\n])\\n
\\n#show list: tree-list\\n#set text(font: \\"DejaVu Sans Mono\\")\\n\\nroot_folder\\\\\\n- sub-folder\\n - 1-1\\n - 1.1.1 -\\n - 1.2\\n - 1.2.1\\n - 1.2.2\\n- 2\\n
\\noutline-summaryst
is a basic package designed for including a summary for each entry in the table of contents, particularly useful for writing books. It provides a simple structure for organizing content and generating formatted documents with summary sections.
Because of the way the project is implemented, only the headings created with the provided make-heading(\\"heading name\\", \\"summary\\")
are shown in in the outline. Headings created with the default = Heading
syntax will not show in said outline (though they will show up in the document itself).
#import \\"@preview/outline-summaryst:0.1.0\\": style-outline, make-heading\\n\\n\\n// you can set `outline-title: none` in order not to display any title\\n#show outline: style-outline.with(outline-title: \\"Table of Contents\\")\\n\\n#outline()\\n\\n\\n#make-heading(\\"Part One\\", \\"This is the summary for part one\\")\\n#lorem(500)\\n\\n#make-heading(\\"Chapter One\\", \\"Summary for chapter one in part one\\", level: 2)\\n#lorem(300)\\n\\n#make-heading(\\"Chapter Two\\", \\"This is the summary for chapter two in part one\\", level: 2)\\n#lorem(300)\\n\\n#make-heading(\\"Part Two\\", \\"And here we have the summary for part two\\")\\n#lorem(500)\\n\\n#make-heading(\\"Chapter One\\", \\"Summary for chapter one in part two\\", level: 2)\\n#lorem(300)\\n\\n#make-heading(\\"Chapter Two\\", \\"Summary for chapter two in part two\\", level: 2)\\n#lorem(300)\\n
\\nThis project is licensed under the MIT License. See the LICENSE file for details.
\\nContributions are welcome! Feel free to open an issue or submit a pull request on GitHub.
\\n","description":"Description outline-summaryst is a basic package designed for including a summary for each entry in the table of contents, particularly useful for writing books. It provides a simple structure for organizing content and generating formatted documents with summary sections.\\n\\nFeatu…","guid":"https://typst.app/universe/package/outline-summaryst","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-15T08:18:49.833Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"superb-pci (0.1.0) | A Peer Community In (PCI) and Peer Community Journal (PCJ) template.","url":"https://typst.app/universe/package/superb-pci","content":"Template for Peer Community In (PCI) submission and Peer Community Journal (PCJ) post-recommendation upload.
\\nThe template is as close as possible to the LaTeX one.
\\nTo use this template in Typst, simply import it at the top of your document.
\\n#import \\"@preview/superb-pci:0.1.0\\": *\\n
\\nAlternatively, you can start using this template from the command line with
\\ntypst init @preview/superb-pci:0.1.0 my-superb-manuscript-dir\\n
\\nor directly in the web app by clicking \\"Start from template\\".
\\nPlease see the main Readme about Typst packages https://github.com/typst/packages.
\\nThis template exports the pci
function with the following named arguments:
title
: the paper titleauthors
: array of author dictionaries. Each author must have the name
field, and can have the optional fields orcid
, and affiliations
.affiliations
: array of affiliation dictionaries, each with the keys id
and name
. All correspondence between authors and affiliations is done manually.abstract
: abstract of the paper as contentdoi
: DOI of the paper displayed on the front pagekeywords
: array of keywords displayed on the front pagecorrespondence
: corresponding address displayed on the front pagenumbered_sections
: boolean, whether sections should be numberedpcj
: boolean, provides a way to remove the front page and headers/footers for upload to the Peer Community Journal. [default: false]
The template will initialize your folder with a sample call to the pci
function in a show rule and dummy content as an example.\\nIf you want to change an existing project to use this template, you can add a show rule like this at the top of your file:
#import \\"@preview/superb-pci:0.1.0\\": *\\n\\n#show: pci.with(\\n title: [Sample for the template, with quite a very long title],\\n abstract: lorem(200),\\n authors: (\\n (\\n name: \\"Antoine Lavoisier\\",\\n orcid: \\"0000-0000-0000-0001\\",\\n affiliations: \\"#,1\\"\\n ),\\n (\\n name: \\"Mary P. Curry\\",\\n orcid: \\"0000-0000-0000-0001\\",\\n affiliations: \\"#,2\\",\\n ),\\n (\\n name: \\"Peter Curry\\",\\n affiliations: \\"2\\",\\n ),\\n (\\n name: \\"Dick Darlington\\",\\n orcid: \\"0000-0000-0000-0001\\",\\n affiliations: \\"1,3\\"\\n ),\\n ),\\n affiliations: (\\n (id: \\"1\\", name: \\"Rue sans aplomb, Paris, France\\"),\\n (id: \\"2\\", name: \\"Center for spiced radium experiments, United Kingdom\\"),\\n (id: \\"3\\", name: \\"Bruce\'s Bar and Grill, London (near Susan\'s)\\"),\\n (id: \\"#\\", name: \\"Equal contributions\\"),\\n ),\\n doi: \\"https://doi.org/10.5802/fake.doi\\",\\n keywords: (\\"Scientific writing\\", \\"Typst\\", \\"PCI\\", \\"Example\\"),\\n correspondence: \\"a-lavois@lead-free-univ.edu\\",\\n numbered_sections: false,\\n pcj: false,\\n)\\n\\n// Your content goes here\\n
\\nYou might also need to use the table_note
function from the template.
Some things that are not straightforward in Typst yet that need to be added in the futures:
\\nA package providing simple image editing capabilities via a WASM plugin.
\\nAvailable functionality includes converting images to grayscale, cropping and flipping the images.\\nFurthermore, this package supports adding transparency and bluring (very slow) as well as handling additional raster image formats.
\\nThe package name is inspired by the blurry, gray images of Nessie, the Loch Ness Monster
\\nDue to the way typst currently interprets given paths, you have to read the images yourself in the calling typst file. This raw imagedata can then be passed to the grayness-package functions, like grayscale-image. These functions also optionally accept all additional parameters of the original typst image function like width
or height
:
#import \\"@preview/grayness:0.2.0\\": grayscale-image\\n\\n#let data = read(\\"Art.webp\\", encoding: none)\\n#grayscale-image(data, width: 50%)\\n
\\nA detailed descriptions of all available functions is provided in the manual.
\\nYou can also use the built-in help functions provided by tidy:
\\n#import \\"@preview/grayness:0.2.0\\": *\\n#help(\\"flip-image-vertical\\")\\n
\\nThe grayscale-image
function also works with SVG images. To do so you must specify the format as \\"svg\\"
:
#let data = read(\\"example.svg\\", encoding: none)\\n#grayscale-image(data, format: \\"svg\\")\\n
\\nHere are several functions applied to a WEBP image of Arturo Nieto Dorantes (CC-By-SA 4.0):\\n
User everyone\'s favorite Catppuccin color palettes in your Typst projects.
\\nTo use the Catppuccin color palette in your Typst project, add the following import statement to your Typst file, and then you can use all the colors from the Catppuccin color palette.
\\n#import \\"@preview/typpuccino:0.1.0\\": latte, frappe, macchiato, mocha\\n\\n#square(fill: mocha.red)\\n
\\nFor more information on available colors, see the this example.
\\n","description":"User everyone\'s favorite Catppuccin color palettes in your Typst projects. Usage\\n\\nTo use the Catppuccin color palette in your Typst project, add the following import statement to your Typst file, and then you can use all the colors from the Catppuccin color palette.\\n\\n#import…","guid":"https://typst.app/universe/package/typpuccino","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-13T09:47:32.643Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"modpattern (0.1.0) | Easily create patterns in typst.","url":"https://typst.app/universe/package/modpattern","content":"This package provides exactly one function: modpattern
It\'s primary goal is to create make this:\\n
The function with the signature\\nmodpattern(size, body, dx: 0pt, dy: 0pt, background: none)
\\nhas the following parameters:
size
is as size for patternsbody
is the inside/body/content of the patterndx
, dy
allow for translationsbackground
allows any type allowed in the box fill argument. It gets applied firstNotice that, in contrast to typst patterns, size is a positional argument.
\\nTake a look at the example directory, to understand how to use this and to see the reasoning behind the background
argument.
Qualitative Colormaps for Typst
\\nQualitative colormaps contain a fixed number of distinct and easily differentiable colors. They are suitable to use for e.g. categorical data visualization.
\\nThe following colormaps are available:
\\nUsage is very simple:
\\n#import \\"@preview/qcm:0.1.0\\": colormap\\n\\n#colormap(\\"Set1\\", 5)\\n
\\n","description":"Qualitative Colormaps for Typst Qualitative colormaps contain a fixed number of distinct and easily differentiable colors. They are suitable to use for e.g. categorical data visualization.\\n\\nSource\\n\\nThe following colormaps are available:\\n\\nall colorbrew qualitive colormaps, for…","guid":"https://typst.app/universe/package/qcm","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-12T09:18:55.053Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"modern-russian-dissertation (0.0.1) | A russian phd thesis template","url":"https://typst.app/universe/package/modern-russian-dissertation","content":"Шаблон русской кандидатской диссертации на языке разметки Typst - современной альтернативы LaTeX.
\\nВ веб-приложении нажмите \\"Start from template\\" и на панели найдите modern-russian-dissertation
.
Вы также можете инициализировать проект командой:
\\ntypst init @preview/modern-russian-dissertation\\n
\\nБудет создана новая директория со всеми файлами, необходимыми для начала работы.
\\nСписок литературы формируется из файлов common/external.bib
и common/author.bib
.
Список сокращений и условных обозначений формируется из данных, записанных в файле common/acronyms.typ
common/symbols.typ
. Список определений формируется из данных в файле common/glossary.typ
.
Для компиляции проекта из CLI используйте:
\\ntypst compile thesis.typ\\n
\\nИли если вы хотите следить за изменениями:
\\ntypst watch thesis.typ\\n
\\nБлагодарность авторам шаблона диссертации на LaTeX
\\nEste es un template para tesis de la facultad de ciencias,\\nen la Universidad Nacional Autónoma de México (UNAM).
\\nThis is a thesis template for the Science Faculty at Universidad Nacional Autónoma de México (UNAM) based on my thesis.
\\nEn la aplicación web de Typst da click en \\"Start from template\\" y busca tlacuache-thesis-fc-unam
.
In the Typst web app simply click \\"Start from template\\" on the dashboard and search for tlacuache-thesis-fc-unam
.
Si estas usando la versión de teminal usa el comando:\\nFrom the CLI you can initialize the project with the command:
\\ntypst init @preview/tlacuache-thesis-fc-unam:0.1.1\\n
\\nPara configurar tu tesis puedes hacerlo con estas lineas al\\ninicio de tu archivo principal.
\\nTo set the thesis template, you can use the following lines\\nin your main file.
\\n#import \\"@preview/tlacuache-thesis-fc-unam:0.1.1\\": thesis\\n\\n#show: thesis.with(\\n ttitulo: [Titulo],\\n grado: [Licenciatura],\\n autor: [Autor],\\n asesor: [Asesor],\\n lugar: [Ciudad de México, México],\\n agno: [#datetime.today().year()],\\n bibliography: bibliography(\\"references.bib\\"),\\n)\\n\\n// Tu tesis va aquí\\n
\\nTambien puedes utilizar estas lineas para crear capítulos con bibliografía,\\nsi deseas crear un pdf solomente para el capítulo.
\\nYou could also create a pdf for just a chapter with bibliography, by using the following lines.
\\n#import \\"@preview/tlacuache-thesis-fc-unam:0.1.1\\": chapter\\n\\n// completamente opcional cargar la bibliografía, compilar el capítulo\\n#show: chapter.with(bibliography: bibliography(\\"references.bib\\"))\\n\\n// Tu capítulo va aquí\\n
\\nSi quieres crear pdf aun mas cortos, puedes utilizar estas lineas para crear un pdf solo para el sección de tu capítulo.
\\nYou could even create a pdf for just a section of a chapter.
\\n#import \\"@preview/tlacuache-thesis-fc-unam:0.1.1\\": section\\n\\n// completamente opcional cargar la bibliografía, compilar el sección\\n#show: section.with(bibliography: bibliography(\\"references.bib\\"))\\n\\n// Tu sección va aquí\\n
\\n","description":"Este es un template para tesis de la facultad de ciencias, en la Universidad Nacional Autónoma de México (UNAM). This is a thesis template for the Science Faculty at Universidad Nacional Autónoma de México (UNAM) based on my thesis.\\n\\nUso/Usage\\n\\nEn la aplicación web de Typst da…","guid":"https://typst.app/universe/package/tlacuache-thesis-fc-unam","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-09T08:20:02.762Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"ibanator (0.1.0) | A package for validating and formatting International Bank Account Numbers (IBANs) according to ISO 13616-1.","url":"https://typst.app/universe/package/ibanator","content":"\\n\\nValidate and format IBAN numbers according to ISO 13616-1.
\\n
#import \\"@preview/ibanator:0.1.0\\": iban\\n\\n#iban(\\"DE89370400440532013000\\")\\n
\\nTo disable validation, set the validate
flag to false:
#iban(\\"DE89370400440532013000\\", validate: false)\\n
\\n","description":"Validate and format IBAN numbers according to ISO 13616-1. Usage\\n#import \\"@preview/ibanator:0.1.0\\": iban\\n\\n#iban(\\"DE89370400440532013000\\")\\n\\n\\nTo disable validation, set the validate flag to false:\\n\\n#iban(\\"DE89370400440532013000\\", validate: false)","guid":"https://typst.app/universe/package/ibanator","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-08T12:19:43.802Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/ibanator/0.1.0/docs/example.png","type":"photo","width":543,"height":298}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"yagenda (0.1.0) | A tabular template for meeting agendas with agenda items defined in Yaml.","url":"https://typst.app/universe/package/yagenda","content":"A Typst template for meeting agendas using Yaml for agenda items. To get started:
\\ntypst init @preview/yagenda:0.1.0\\n
\\nAnd edit the main.typ
example. The data are drawn from agenda.yaml
.
PRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.
\\nThe Typst grid layout was designed by PgSuper on Discord.
\\n","description":"A Typst template for meeting agendas using Yaml for agenda items. To get started: typst init @preview/yagenda:0.1.0\\n\\n\\nAnd edit the main.typ example. The data are drawn from agenda.yaml.\\n\\nContributing\\n\\nPRs are welcome! And if you encounter any bugs or have any requests/ideas, feel…","guid":"https://typst.app/universe/package/yagenda","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-08T09:09:49.628Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/yagenda/0.1.0/thumbnail.png","type":"photo","width":2923,"height":2067}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"exzellenz-tum-thesis (0.1.0) | Customizable template for a thesis at the TU Munich","url":"https://typst.app/universe/package/exzellenz-tum-thesis","content":"This is a Typst template for a thesis at TU Munich. I made it for my thesis in the School CIT, but I think it can be adapted to other schools as well.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for exzellenz-tum-thesis
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/exzellenz-tum-thesis\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the exzellenz-tum-thesis
function with the following named arguments:
degree
: Stringprogram
: Stringschool
: Stringsupervisor
: Stringadvisor
: Array of Stringsauthor
: StringstartDate
: StringtitleEn
: StringtitleDe
: StringabstractEn
: Content blockabstractDe
: Content blockacknowledgements
: Content blocksubmissionDate
: StringshowTitleInHeader
: Booleandraft
: BooleanThe template will initialize your package with a sample call to the exzellenz-tum-thesis
function.
Typst Lab Report Template
\\nclone this repo into the local package directory, notice that the version should be specified (e.g. .../unilab/0.0.1/
)
Cuti is a package that simulates fake bold / fake italic. This package is typically used on fonts that do not have a bold
weight, such as \\"SimSun\\".
Please refer to the English Demo & Doc.
\\n本 Package 提供中文文档: 中文 Demo 与文档。
\\nPlease add the following content at the beginning of the document:
\\n#import \\"@preview/cuti:0.2.1\\": show-cn-fakebold\\n#show: show-cn-fakebold\\n
\\nThen, the bolding for SimHei, SimSun, and KaiTi fonts should work correctly.
\\n0.2.1
0.2.0
0.1.0
MIT License
\\nThis package refers to the following content:
\\n_skew
comes from Enivex\'s code.)Thanks to Enter-tainer for the assistance.
\\n","description":"Cuti is a package that simulates fake bold / fake italic. This package is typically used on fonts that do not have a bold weight, such as \\"SimSun\\". Usage\\n\\nPlease refer to the English Demo & Doc.\\n\\n本 Package 提供中文文档: 中文 Demo 与文档。\\n\\nGetting Started Quickly (For Chinese User)\\n\\nPlease add…","guid":"https://typst.app/universe/package/cuti","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-05T15:40:54.924Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"jurz (0.1.0) | Randziffern in Typst","url":"https://typst.app/universe/package/jurz","content":"Randziffern (also called Randnummern) are a way to reference text passages in a document, independent of the page number or the section number. They are used in many German legal texts, for example. This package provides a way to create Randziffern in Typst.
\\n\\n | \\n \\n | \\n
#show: init-jurz.with(\\n gap: 1em,\\n two-sided: true\\n)\\n\\n#rz #lorem(50)\\n\\n#lorem(20)\\n\\n#rz<abc> #lorem(30)\\n\\n#rz #lorem(40)\\n\\n#rz #lorem(50)\\n\\n#lorem(20)\\n\\n#rz #lorem(24)\\n\\nFur further information, look at @abc.\\n
\\ninit-jurz
A show rule that initializes the Randziffern for the document. This rule should be placed at the beginning of the document. It also allows customizing the behavior of the Randziffern.
\\n#show: init-jurz.with(\\n // parameters\\n // two-sided: true,\\n // gap: 1em,\\n // supplement: \\"Rz.\\",\\n // reset-level: 0,\\n)\\n
\\ntwo-sided
(optional): If true
, the Randziffern are placed on the outer margin of the page. If false
, they are placed on the left margin. Default is true
.gap
(optional): The distance between the Randziffer and the text. Default is 1em
.supplement
(optional): The text that is placed before the Randziffer when referencing it. Default is \\"Rz.\\"
.reset-level
(optional): The heading level at which the Randziffern are reset. If set to 3
, for example, the numbering of the Randziffern restarts after every heading of levels 1
, 2
, or 3
. Default is 0
.rz
Adds a Randziffer to the text. The Randziffer is a unique identifier that can be referenced in the text.
\\nYou can add references the same way you can with headings. In fact, the Randziffer is treated as a heading of level 99
under the hood.
#rz #lorem(100)\\n#rz<abc> #lorem(100)\\n\\nSee also @abc.\\n
\\nThis package is licensed under the MIT License.
\\n","description":"Randziffern (also called Randnummern) are a way to reference text passages in a document, independent of the page number or the section number. They are used in many German legal texts, for example. This package provides a way to create Randziffern in Typst. Demo…","guid":"https://typst.app/universe/package/jurz","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-04T10:38:28.837Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/jurz/0.1.0/demo-2.svg","type":"photo","width":566,"height":803},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/jurz/0.1.0/demo-3.svg","type":"photo","width":566,"height":803}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"zen-zine (0.1.0) | Excellently type-set a fun little zine!","url":"https://typst.app/universe/package/zen-zine","content":"Excellently type-set a cute little zine about your favorite topic!
\\nProviding your eight pages in order will produce a US-Letter page with\\nthe content in a layout ready to be folded into a zine! The content is\\nwrapped before movement so that padding and alignment are respected.
\\nHere is the template and its preview:
\\n#import \\"@preview/zen-zine:0.1.0\\": zine\\n\\n#set document(author: \\"Tom\\", title: \\"Zen Zine Example\\")\\n#set text(font: \\"Linux Libertine\\", lang: \\"en\\")\\n\\n#let my_eight_pages = (\\n range(8).map(\\n number => [\\n #pad(2em, text(10em, align(center, str(number))))\\n ]\\n )\\n)\\n\\n// provide your content pages in order and they\\n// are placed into the zine template positions.\\n// the content is wrapped before movement so that\\n// padding and alignment are respected.\\n#zine(\\n // draw_border: true,\\n // zine_page_margin: 5pt,\\n contents: my_eight_pages\\n)\\n
\\nRoughly in order of priority.
\\npage
properties so that user can change the page they wish to use.\\nflipped
and deduce the zine page width and height\\nfrom the full page width and height (and the zine margin)#get
equivalent to #set
?)Caidan (菜单 in Chinese, /cài dān/, meaning food menu) is a clean and minimal food menu template.
\\nSee the example.pdf file to see how it looks. Additionally, cu1ch3n/menu serves as a practical example project utilizing this template.
\\nEnsure that WebOMints GD, LXGW WenKai, and Ysabeau Infant fonts are installed first. The required fonts are provided in fonts.
\\nTo use this template with typst.app, you may upload the required fonts manually (Note: LXGW WenKai may be too large to upload onto typst.app).
\\nThis template includes the caidan
function, which comes with several configurable named arguments:
| Argument | Default Value | Type | Description |\\n| --- | --- | --- | --- |\\n| title
| none
| content | The title for your menu |\\n| cover_image
| none
| content | The image on the menu\'s cover page |\\n| update_date
| none
| datetime | This date will be displayed on the cover page in both Chinese and English |\\n| page_height
| 595.28pt
| length | Page height of your menu |\\n| page_width
| 841.89pt
| length | Page width of your menu |\\n| num_columns
| 3
| int | The number of columns per page |
The function also accepts a single, positional argument for the body.
\\n#import \\"@preview/caidan:0.1.0\\": *\\n\\n#show: caidan.with(\\n title: [#en_text(22pt, fill: nord0)[Chen\'s Private Cuisine]],\\n cover_image: image(\\"cover.png\\"),\\n update_date: datetime.today(),\\n num_columns: 3,\\n)\\n\\n#cuisine[鲁菜][Shandong Cuisine]\\n- #item[葱烧海参][Braised Sea Cucumber w/ Scallions]\\n- #item[葱爆牛肉][Scallion Beef Stir-Fry]\\n- #item[醋溜白菜][Napa Cabbage Stir-Fry w/ Vinegar]\\n\\n#cuisine[川菜][Sichuan Cuisine]\\n- #item[宫保鸡丁][Gong Bao Chicken]\\n- #item[回锅肉][Twice-cooked pork]\\n- #item[麻婆豆腐][Mapo Tofu]\\n
\\n","description":"Caidan (菜单 in Chinese, /cài dān/, meaning food menu) is a clean and minimal food menu template. See the example.pdf file to see how it looks. Additionally, cu1ch3n/menu serves as a practical example project utilizing this template.\\n\\nUsage\\n\\nEnsure that WebOMints GD, LXGW WenKai, an…","guid":"https://typst.app/universe/package/caidan","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-03T08:30:54.803Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"pintorita (0.1.2) | Package to draw Sequence Diagrams, Entity Relationship Diagrams, Component Diagrams, Activity Diagrams, Mind Maps, Gantt Diagrams,...","url":"https://typst.app/universe/package/pintorita","content":"Typst package for drawing the following from markup:
\\n#import \\"@preview/pintorita:0.1.2\\"\\n\\n#set page(height: auto, width: auto, fill: black, margin: 2em)\\n#set text(fill: white)\\n\\n#show raw.where(lang: \\"pintora\\"): it => pintorita.render(it.text)\\n\\n= pintora\\n\\nTypst just got a load of diagrams. \\n\\n```pintora\\nmindmap\\n@param layoutDirection TB\\n+ UML Diagrams\\n++ Behavior Diagrams\\n+++ Sequence Diagram\\n+++ State Diagram\\n+++ Activity Diagram\\n++ Structural Diagrams\\n+++ Class Diagram\\n+++ Component Diagram\\n```\\n\\n```\\nmindmap\\n@param layoutDirection TB\\n+ UML Diagrams\\n++ Behavior Diagrams\\n+++ Sequence Diagram\\n+++ State Diagram\\n+++ Activity Diagram\\n++ Structural Diagrams\\n+++ Class Diagram\\n+++ Component Diagram\\n```\\n\\n
\\nrender
Render a pintora string to an image
\\nsrc
: str
- pintora source stringfactor
: scale output svg, \\"factor:0.5\\" will scale images down by half, so scale can be consistent across renders.style
: str
diagram style, default
or dark
or larkLight
or larkDark
font
: str
font family, default is Source Code Pro, sans-serif
image.decode
so you can customize the image sizeThe image, of type content
render-svg
Render a pintora string to an image
\\nsrc
: str
- pintora source stringfactor
: scale output svg, \\"factor:0.5\\" will scale images down by half, so scale can be consistent across renders.style
: str
diagram style, default
or dark
or larkLight
or larkDark
font
: str
font family, default is Source Code Pro, sans-serif
image.decode
so you can customize the image sizeThe svg image
\\nrender-svg
function and more customization optionsA template for creating business letters following the DIN 5008 standard.
\\ntypst-letter-pro provides a convenient and professional way to generate business letters\\nwith a standardized layout. The template follows the guidelines specified in the\\nDIN 5008 standard, ensuring that your letters adhere to the commonly accepted business\\ncommunication practices.
\\nThe goal of typst-letter-pro is to simplify the process of creating business letters\\nwhile maintaining a clean and professional appearance. It offers predefined sections\\nfor the sender and recipient information, subject, date, header, footer and more.
\\nText source: Musterbrief Widerspruch gegen Einkommensteuerbescheid
\\n#import \\"@preview/letter-pro:3.0.0\\": letter-simple\\n\\n#set text(lang: \\"de\\")\\n\\n#show: letter-simple.with(\\n sender: (\\n name: \\"Anja Ahlsen\\",\\n address: \\"Deutschherrenufer 28, 60528 Frankfurt\\",\\n extra: [\\n Telefon: #link(\\"tel:+4915228817386\\")[+49 152 28817386]\\\\\\n E-Mail: #link(\\"mailto:aahlsen@example.com\\")[aahlsen\\\\@example.com]\\\\\\n ],\\n ),\\n \\n annotations: [Einschreiben - Rückschein],\\n recipient: [\\n Finanzamt Frankfurt\\\\\\n Einkommenssteuerstelle\\\\\\n Gutleutstraße 5\\\\\\n 60329 Frankfurt\\n ],\\n \\n reference-signs: (\\n ([Steuernummer], [333/24692/5775]),\\n ),\\n \\n date: \\"12. November 2014\\",\\n subject: \\"Einspruch gegen den ESt-Bescheid\\",\\n)\\n\\nSehr geehrte Damen und Herren,\\n\\ndie von mir bei den Werbekosten geltend gemachte Abschreibung für den im\\nvergangenen Jahr angeschafften Fotokopierer wurde von Ihnen nicht berücksichtigt.\\nDer Fotokopierer steht in meinem Büro und wird von mir ausschließlich zu beruflichen\\nZwecken verwendet.\\n\\nIch lege deshalb Einspruch gegen den oben genannten Einkommensteuerbescheid ein\\nund bitte Sie, die Abschreibung anzuerkennen.\\n\\nAnbei erhalten Sie eine Kopie der Rechnung des Gerätes.\\n\\nMit freundlichen Grüßen\\n#v(1cm)\\nAnja Ahlsen\\n\\n#v(1fr)\\n*Anlagen:*\\n- Rechnung\\n
\\nImport the package in your document:
\\n#import \\"@preview/letter-pro:3.0.0\\": letter-simple\\n
\\nDownload the repository to the local package namespace using Git:
\\n$ git clone -c advice.detachedHead=false https://github.com/Sematre/typst-letter-pro.git --depth 1 --branch v3.0.0 ~/.local/share/typst/packages/local/letter-pro/3.0.0\\n
\\nThen import the package in your document:
\\n#import \\"@local/letter-pro:3.0.0\\": letter-simple\\n
\\nDownload the letter-pro-v3.0.0.typ
file from the releases page and place it next to your document file, e.g., using wget:
$ wget https://github.com/Sematre/typst-letter-pro/releases/download/v3.0.0/letter-pro-v3.0.0.typ\\n
\\nThen import the package in your document:
\\n#import \\"letter-pro-v3.0.0.typ\\": letter-simple\\n
\\nContributions to typst-letter-pro are welcome! If you encounter any issues or have\\nsuggestions for improvements, please open an issue on GitHub or submit a pull request.
\\nBefore making any significant changes, please discuss your ideas with the project\\nmaintainers to ensure they align with the project\'s goals and direction.
\\nThis project is inspired by the following projects and resources:
\\nDistributed under the MIT License. See LICENSE
for more information.
ttt-lists
is a template to create class lists and belongs to the typst-teacher-tools-collection.
Run this command inside your terminal to init a new list.
\\ntypst init @preview/ttt-lists my-student-list\\n
\\nThis will scaffold the following folder structure.
\\nmy-student-list/\\n├─ students.csv\\n└─ students.typ\\n
\\nEdit the students.csv
file or replace it with your own. Modify the students.typ
to your liking or leave as is and then run typst compile students.typ
to create a beautiful list.
This is a Typst template for COMAP\'s Mathematical Contest in MCM/ICM.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for mcm-scaffold
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/mcm-scaffold\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the mcm
function with the following named arguments:
title
: The paper\'s title as content.problem-chosen
: The problem your team have chosen.team-control-number
: Your team control number.year
: When did the competition took place.summary
: The content of a brief summary of the paper. Appears at the top of the first column in boldface.keywords
: Keywords of the paper.magic-leading
: adjust the leading of the summary.The function also accepts a single, positional argument for the body of the\\npaper.
\\nThe template will initialize your package with a sample call to the mcm
\\nfunction in a show rule. If you want to change an existing project to use this\\ntemplate, you can add a show rule like this at the top of your file:
#import \\"@preview/mcm-scaffold:0.1.0\\": *\\n\\n#show: mcm.with(\\n title: \\"A Simple Example for MCM/ICM Typst Template\\",\\n problem-chosen: \\"ABCDEF\\",\\n team-control-number: \\"1111111\\",\\n year: \\"2025\\",\\n summary: [\\n #lorem(100)\\n \\n #lorem(100)\\n \\n #lorem(100)\\n\\n #lorem(100)\\n ],\\n keywords: [MCM; ICM; Mathemetical; template],\\n magic-leading: 0.65em,\\n)\\n\\n// Your content goes below.\\n
\\n","description":"This is a Typst template for COMAP\'s Mathematical Contest in MCM/ICM. Usage\\n\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the dashboard and searching for mcm-scaffold.\\n\\nAlternatively, you can use the CLI to kick this project off using the…","guid":"https://typst.app/universe/package/mcm-scaffold","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-04-02T11:19:23.458Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"physica (0.9.3) | Math constructs for science and engineering: derivative, differential, vector field, matrix, tensor, Dirac braket, hbar, transpose, ...","url":"https://typst.app/universe/package/physica","content":":green_book: The manual.
\\n\\n\\n
Available in the collection of Typst packages: #import \\"@preview/physica:0.9.3\\": *
\\n\\nphysica noun.
\\n\\n
\\n- Latin, study of nature
\\n
This Typst package provides handy typesetting utilities for\\nnatural sciences, including:
\\n..^T
as transpose and ..^+
as dagger (conjugate transpose),See the manualfor more details and examples.
\\nA larger demo.typ:
\\ntypst
package management (recommended)See https://github.com/typst/packages. If you are using the Typst\'s web app,\\npackages listed there are readily available; if you are using the Typst\\ncompiler locally, it downloads packages on-demand and caches them on-disk, see\\nhere for details.
\\n\\n\\n
// Style 1\\n#import \\"@preview/physica:0.9.3\\": *\\n\\n$ curl (grad f), tensor(T, -mu, +nu), pdv(f,x,y,[1,2]) $\\n
\\n// Style 2\\n#import \\"@preview/physica:0.9.3\\": curl, grad, tensor, pdv\\n\\n$ curl (grad f), tensor(T, -mu, +nu), pdv(f,x,y,[1,2]) $\\n
\\n// Style 3\\n#import \\"@preview/physica:0.9.3\\"\\n\\n$ physica.curl (physica.grad f), physica.tensor(T, -mu, +nu), physica.pdv(f,x,y,[1,2]) $\\n
\\ntypst
package managementSimilar to examples above, but import with the undecorated file path like \\"physica.typ\\"
.
The version requirement for the compiler is in typst.toml\'s\\ncompiler
field. If you are using an unsupported Typst version, the compiler\\nwill throw an error. You may want to update your compiler with typst update
,\\nor choose an earlier version of the physica
package.
Developed with compiler version:
\\n$ typst --version\\ntypst 0.10.0 (70ca0d25)\\n
\\nSee the manual for a more comprehensive coverage, a PDF file\\ngenerated directly with the Typst binary.
\\nTo regenerate the manual, use command
\\ntypst watch physica-manual.typ\\n
\\nBug fixes are welcome!
\\nNew features: welcome as well. If it is small, feel free to create a pull\\nrequest. If it is large, the best first step is creating an issue and let us\\nexplore the design together. Some features might warrant a package on its own.
\\nTesting: currently testing is done by closely inspecting the generated\\nmanual.\\nThis does not scale well. I plan to add programmatic testing by comparing\\nrendered pictures with golden images.
\\nPass down arguments of sum
, integral
, etc. to the next line, which\\ncan generate shorthand to present reusable segments. While writing long\\nstep-by-step equations, only certain parts of a line change. down
\\nleverages Typst\'s context
(from version 0.11.0) to help relieve the\\npressure of writing long and repetitive formulae.
Import the package:
\\n#import \\"@preview/down:0.1.0\\": *\\n
\\nCreate new contexts by using camel-case commands, such as\\nLimit(x, +0)
. Retrieve the contextual with cLimit
.
Limit(x, c)
and cLimit
:$\\nLim(x, +0) x ln(sin x)\\n = cLim ln(sin x) / x^(-1)\\n = cLim x / (sin x) cos x\\n = 0\\n$\\n
\\nSum(index, lower, upper)
and cSum
:$\\nSum(n, 0, oo) 1 / sqrt(n + 1)\\n = Sum(#none, 0, #none) 1 / sqrt(n)\\n = cSum 1 / n^(1 / 2)\\n$\\n
\\nIntegral(lower, upper, f, dif: [x])
, cIntegral(f)
and\\ncIntegrated(f)
:$\\nIntegral(0, pi / 3, sqrt(1 + tan^2 x))\\n = cIntegral(1 / (cos x))\\n = cIntegrated(ln (cos x / 2 + sin x / 2) / (cos x / 2 - sin x / 2))\\n = ln (2 + sqrt(3))\\n$\\n
\\nRefer to ./sample.pdf
for more complex application.
Generate beautiful invoices from a simple data record.
\\n<img\\nalt=\\"Example invoice\\"\\nsrc=\\"thumbnail.png\\"\\nheight=\\"768\\"
\\n\\n.typ
or .yaml
files#import \\"@preview/invoice-maker:1.0.0\\": *\\n\\n#show: invoice.with(\\n language: \\"en\\", // or \\"de\\"\\n banner_image: image(\\"banner.png\\"),\\n invoice_id: \\"2024-03-10t183205\\",\\n …\\n)\\n
\\nCheck out the GitHub repository\\nfor more information and examples.
\\n","description":"Generate beautiful invoices from a simple data record.A report Typst template for IFSC-SJ.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for klaro-ifsc-sj
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/klaro-ifsc-sj\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the report
function with the following named arguments:
title
: The reoirt\'s title as string. This is displayed at the center of the cover page.subtitle
: The report\'s subtitle as string. This is displayed below the title at the cover page.authors
: The array of authors as strings. Each author is displayed on a separate line at the cover page.date
: The date of the last revision of the report. This is displayed at the bottom of the cover page.A Typst template based on popular LateX template used in arXiv and bio-arXiv. Inspired by arxiv-style
\\nImport
\\n#import \\"@preview/arkheion:0.1.0\\": arkheion, arkheion-appendices\\n
\\nMain body
\\n#show: arkheion.with(\\n title: \\"ArXiv Typst Template\\",\\n authors: (\\n (name: \\"Author 1\\", email: \\"user@domain.com\\", affiliation: \\"Company\\", orcid: \\"0000-0000-0000-0000\\"),\\n (name: \\"Author 2\\", email: \\"user@domain.com\\", affiliation: \\"Company\\"),\\n ),\\n // Insert your abstract after the colon, wrapped in brackets.\\n // Example: `abstract: [This is my abstract...]`\\n abstract: lorem(55),\\n keywords: (\\"First keyword\\", \\"Second keyword\\", \\"etc.\\"),\\n date: \\"May 16, 2023\\",\\n)\\n
\\nAppendix
\\n#show: arkheion-appendices\\n=\\n\\n== Appendix section\\n\\n#lorem(100)\\n\\n
\\nThe MIT License (MIT)
\\nCopyright (c) 2023 Manuel Goulão
\\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
\\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
\\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\\n","description":"A Typst template based on popular LateX template used in arXiv and bio-arXiv. Inspired by arxiv-style Usage\\n\\nImport\\n\\n#import \\"@preview/arkheion:0.1.0\\": arkheion, arkheion-appendices\\n\\n\\nMain body\\n\\n#show: arkheion.with(\\n title: \\"ArXiv Typst Template\\",\\n authors: (\\n (name: \\"Author 1…","guid":"https://typst.app/universe/package/arkheion","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-23T11:41:21.998Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"abiding-ifacconf (0.1.0) | An IFAC-style paper template to publish at conferences for International Federation of Automatic Control","url":"https://typst.app/universe/package/abiding-ifacconf","content":"IFAC stands for International Federation of Automatic Control.\\nThis repository is meant to be a port of the existing author tools for conference papers (e.g., for LaTeX, see ifacconf_latex.zip) for Typst.
\\nRunning the following command will create a new directory with all the files that are needed:
\\ntypst init @preview/abiding-ifacconf\\n
\\nThis template exports the ifacconf
function with the following named arguments:
authors
: (default: ()) array of authors. For each author you can specify a name, email (optional), and affiliation. The affiliation must be an integer corresponding to an entry in the 1-indexed affiliations list (or 0 for no affiliation).affiliations
: (default: ()) array of affiliations. For each affiliation you can specify a department, organization, and address. Everything is optional (i.e., an affiliation can be an empty array).abstract
: (default: none) the paper\'s abstract. Can be omitted if you don\'t have one.keywords
: (default: ()) array of keywords to display after the abstractsponsor
: (default: none) acknowledgment of sponsor or financial support (appears as a footnote on the first page)#import \\"@preview:abiding-ifacconf:0.1.0\\": *\\n#show: ifacconf-rules\\n#show: ifacconf.with(\\n title: \\"Minimal Working Example\\",\\n authors: (\\n (\\n name: \\"First A. Author\\",\\n email: \\"author@boulder.nist.gov\\",\\n affiliation: 1,\\n ),\\n ),\\n affiliations: (\\n (\\n department: \\"Engineering\\",\\n organization: \\"National Institute of Standards and Technology\\",\\n address: \\"Boulder, CO 80305 USA\\",\\n ),\\n ),\\n abstract: [\\n Abstract should be 50-100 words.\\n ],\\n keywords: (\\"keyword1\\", \\"keyword2\\"),\\n sponsor: [\\n Sponsor information.\\n ],\\n)\\n\\n= Introduction\\n\\nA minimum working example (with bibliography) @Abl56.\\n\\n#lorem(80)\\n\\n#lorem(80)\\n\\n#bibliography(\\"refs.bib\\")\\n
\\nSee main.typ
.
#show: ifacconf-rules
is necessary for some show rules defined in template.typ
to get activatedifac-conference.csl
is a lightly modified version of apa.csl
and is included in order to change the citation format from, e.g., (Able 1956)
to Able (1956)
in order to match ifacconf_latex
figure
with kind: \\"table\\"
; a convenience function tablefig
is provided which sets this automaticallyifacconf_latex
are defined in template.typ
; simply call, for example, #theorem[Content...] ... #proof[Proof...]
ifacconf_latex
)ifacconf.typ
) but probably there is a better way to handle this now or in the futurerefs.bib
(essentially) and bifurcation.jpg
come from ifacconf_latex
ifacconf.typ
is modeled directly after ifacconf.tex
by Juan a. de la Puentecitep
function renders citations like (Keohane, 1958)
instead of the default style of Keohane (1958)
This template is licensed according to the MIT No Attribution license (see LICENSE.MD
).
The files in the CSL
folder are licensed according to CSL/LICENSE.md
(CC BY/SA 4.0) because it is a lightly modified version of apa.csl
by Brenton M. Wiernik which is also licensed by a CC BY/SA license.
This is a thesis template for the University of Turin (UniTO) based on my thesis, since there are no strict templates (notable mention to Eugenio\'s LaTeX template though) take my choices with a grain of salt, different supervisors may ask you to customize the template differently. My choices are loosely based on this document: Indicazioni per il Format della Tesi.
\\nIf you find errors or ways to improve the template please open an issue or contribute directly with a PR.
\\nIn the Typst web app simply click \\"Start from template\\" on the dashboard and search for modern-unito-thesis
.
From the CLI you can initialize the project with the command
\\ntypst init @preview/modern-unito-thesis\\n
\\nA new directory with all the files needed to get started will be created.
\\nThis template exports the template
function with the following named arguments:
title
: the title of the thesisacademic-year
: the academic year (e.g. 2023/2024)subtitle
: e.g. \\"Bachelor\'s Thesis\\"paper-size
(default a4
): the paper formatcandidate
: your name, surname and matricola (student id)supervisor
(relatore): your supervisor\'s name and surnameco-supervisor
(correlatore): an array of your co-supervisors\' names and surnamesaffiliation
: a dictionary that specifies university
, school
and degree
keywordslang
: configurable between en
for English and it
for Italianbibliography-path
: the path to your bibliography file (e.g. works.bib
)logo
(already set to UniTO\'s logo by default): the path to your university\'s logoabstract
: your thesis\' abstract, can be set to none
if not neededacknowledgments
: your thesis\' acknowledgments, can be set to none
if not neededkeywords
: a list of keywords for the thesis, can be set to none
if not neededThe template will initialize an example project with sensible defaults.
\\nThe template divides the level 1 headings in chapters under the chapters
directory, I suggest using this structure to keep the project organized.
If you want to change an existing project to use this template, you can add a show rule like this at the top of your file:
\\n#import \\"@preview/modern-unito-thesis:0.1.0\\": template\\n\\n#show: template.with(\\n title: \\"My Beautiful Thesis\\",\\n academic-year: [2023/2024],\\n subtitle: \\"Bachelor\'s Thesis\\",\\n logo: image(\\"path/to/your/logo.png\\"),\\n candidate: (\\n name: \\"Eduard Antonovic Occhipinti\\",\\n matricola: 947847\\n ),\\n supervisor: (\\n \\"Prof. Luigi Paperino\\"\\n ),\\n co-supervisor: (\\n \\"Dott. Pluto Mario\\",\\n \\"Dott. Minni Topolino\\"\\n ),\\n affiliation: (\\n university: \\"Università degli Studi di Torino\\",\\n school: \\"Scuola di Scienze della Natura\\",\\n degree: \\"Corso di Laurea Triennale in Informatica\\",\\n ),\\n bibliography: bibliography(\\"works.yml\\"),\\n abstract: [Your abstract goes here],\\n acknowledgments: [Your acknowledgments go here],\\n keywords: [keyword1, keyword2, keyword3]\\n)\\n\\n// Your content goes here\\n
\\nTo compile the project from the CLI you just need to run
\\ntypst compile main.typ\\n
\\nor if you want to watch for changes (recommended)
\\ntypst watch main.typ\\n
\\nI integrated the bibliography as a Hayagriva yaml
file under works.yml, nonetheless using the more common bib
format for your bibliography management is as simple as passing a BibTex file to the template bibliography
parameter. Given that our university is not strict in this regard I suggest using Hayagriva though :).
This package defines some colourful badges and boxes around text that represent user interface actions such as a click or following a menu.
\\nFor examples have a look at the example main.typ, main.pdf.
\\n#badge-gray(\\"Gray badge\\"),\\n#badge-red(\\"Red badge\\"),\\n#badge-yellow(\\"Yellow badge\\"),\\n#badge-green(\\"Green badge\\"),\\n#badge-blue(\\"Blue badge\\"),\\n#badge-purple(\\"Purple badge\\")\\n
\\nThis is a user interface action (ie. a click):
\\n#ui-action(\\"Click X\\")\\n
\\nThis is an action to follow a user interface menu (2 steps):
\\n#menu((\\"File\\", \\"New File...\\"))\\n
\\nThis is a menu action with multiple steps:
\\n#menu((\\"Menu\\", \\"Sub-menu\\", \\"Sub-sub menu\\", \\"Action\\"))\\n
\\n","description":"This package defines some colourful badges and boxes around text that represent user interface actions such as a click or following a menu. For examples have a look at the example main.typ, main.pdf.\\n\\nBadges\\n#badge-gray(\\"Gray badge\\"),\\n#badge-red(\\"Red badge\\"),\\n#badge-yellow…","guid":"https://typst.app/universe/package/badgery","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-20T09:36:36.762Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/badgery/0.1.1/demo.png","type":"photo","width":1296,"height":1476}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"xarrow (0.3.1) | Variable-length arrows in Typst.","url":"https://typst.app/universe/package/xarrow","content":"Variable-length arrows in Typst, fitting the width of a given content.
\\nThis library mainly provides the xarrow
function. This function takes one\\npositional argument, which is the content to display on top of the arrow.\\nAdditionally, the library provides the following arrow styles:
xarrowDashed
using arrow sym.arrow.dashed
.xarrowDouble
using arrow sym.arrow.double.long
;xarrowHook
using arrow sym.arrow.hook
;xarrowSquiggly
using arrow sym.arrow.long.squiggly
;xarrowTwoHead
using arrow sym.arrow.twohead
;These names use camlCase in order to be simply called from math mode. This may\\nchange in the future, if it becomes possible to have the function names\\nmirror the dot-separated name of the symbols themselves.
\\nUsers can provide the following arguments to any of the previously-mentioned\\nfunctions:
\\nwidth
defines the width of the arrow. It defaults to auto
, which makes the\\narrow adapt to the size of the body.margins
defines the spacing on each side of the body
argument. Ignored when\\nwidth
is not auto
.position
defines whether the main body
argument will be set above or below\\nthe arrow. Default is top
; the only other accepted value is bottom
.opposite
sets the content that is displayed on the other, non-default side\\nof the arrow. Default is none
.#import \\"@preview/xarrow:0.3.0\\": xarrow, xarrowSquiggly, xarrowTwoHead\\n\\n$\\n a xarrow(sym: <--, QQ\\\\, 1 + 1^4) b \\\\\\n c xarrowSquiggly(\\"very long boi\\") d \\\\\\n c / ( a xarrowTwoHead(\\"NP\\" limits(sum)^*) b times 4)\\n$\\n
\\nThe xarrow
function has several named arguments which serve to create new\\narrow designs:
sym
is the base symbol.sections
defines the way the symbol is divided. Drawing an arrow consists of\\ndrawing its tail, then repeating a central part that is defined by sections
,\\nthen drawing the head. This is the parameter that has to be tweaked if\\nobserving artefacts. sections
are given as two ratios, delimiting\\nrespectively the beginning and the end of the central, repeated part of the\\nsymbol.partial_repeats
indicates whether the central part of the symbol can be\\npartially repeated at the end in order to match the exact desired width. This\\nhas to be disabled when the repeated part has a clear period (like the\\nsquiggly arrow).#let xarrowSquigglyBottom = xarrow.with(\\n sym: sym.arrow.long.squiggly,\\n sections: (20%, 45%),\\n partial_repeats: false,\\n position: bottom,\\n)\\n
\\nsections
argument) to be rendered correctly.width
argument cannot be given ratio/fractions like other shapes. This\\nwould be a nice feature to have, in order to be able to create an arrow that\\ntakes 50% of the available line width for instance.Fuzzy CNOI Statement is a template for CNOI(Olympiad in Informatics in China)-style statements for competitive programming.
\\nFuzzy CNOI Statement 是一个 CNOI 题面排版风格的 Typst 模板。
\\nIt is mainly designed to mimic the appearance of official CNOI-style statements, which are usually generated by TUACK.
\\n其主要模仿国内 NOI 系列比赛官方题面的外观。这些题面一般由 TUACK 生成。
\\nThis template is not affiliated with the China Computer Federation (CCF) or the NOI Committee. When using this template, it is recommended to indicate the unofficial nature of the contest to avoid misunderstandings.
\\n该模板与中国计算机学会(CCF)、NOI 委员会官方无关。在使用该模板时,建议标明比赛的非官方性质,以免造成误解。
\\nHere are the fonts that this template will use, you can change the font by passing parameters:
\\n以下是该模板会用到的字体,你可以通过传入参数的方式更换字体:
// Define your contest information and problem list\\n// 定义比赛信息和题目列表\\n\\n#let (init, title, problem-table, next-problem, filename, current-filename, current-sample-filename, data-constraints-table-args) = document-class(\\n contest-info,\\n prob-list,\\n)\\n\\n#show: init\\n\\n#title()\\n\\n#problem-table()\\n\\n*注意事项(请仔细阅读)*\\n+ ...\\n\\n#next-problem()\\n== 题目描述\\n...\\n
\\nRefer to main.typ
for a complete example.
main.typ
提供了一个完整的示例。
You can use this template in the Typst web app by clicking Start from\\ntemplate on the dashboard and searching for bloated-neurips
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/bloated-neurips\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the neurips2023
and neurips2024
function with the\\nfollowing named arguments.
title
: The paper\'s title as content.authors
: An array of author dictionaries. Each of the author dictionaries\\nmust have a name key and can have the keys department, organization,\\nlocation, and email.abstract
: The content of a brief summary of the paper or none. Appears at\\nthe top under the title.bibliography
: The result of a call to the bibliography function or none.\\nThe function also accepts a single, positional argument for the body of the\\npaper.appendix
: A content which is placed after bibliography.accepted
: If this is set to false
then anonymized ready for submission\\ndocument is produced; accepted: true
produces camera-redy version. If\\nthe argument is set to none
then preprint version is produced (can be\\nuploaded to arXiv).The template will initialize your package with a sample call to the\\nneurips2024
function in a show rule. If you want to change an existing\\nproject to use this template, you can add a show rule at the top of your file\\nas follows.
#import \\"@preview/bloated-neurips:0.5.1\\": neurips2024\\n\\n#show: neurips2024.with(\\n title: [Formatting Instructions For NeurIPS 2024],\\n authors: (authors, affls),\\n keywords: (\\"Machine Learning\\", \\"NeurIPS\\"),\\n abstract: [\\n The abstract paragraph should be indented ½ inch (3 picas) on both the\\n left- and right-hand margins. Use 10 point type, with a vertical spacing\\n (leading) of 11 points. The word *Abstract* must be centered, bold, and in\\n point size 12. Two line spaces precede the abstract. The abstract must be\\n limited to one paragraph.\\n ],\\n bibliography: bibliography(\\"main.bib\\"),\\n appendix: [\\n #include \\"appendix.typ\\"\\n #include \\"checklist.typ\\"\\n ],\\n accepted: false,\\n)\\n\\n#lorem(42)\\n
\\nWith template of version v0.5.1 or newer, one can override some parts.\\nSpecifically, get-notice
entry of aux
directory parameter of show rule\\nallows to adjust the NeurIPS 2024 template to Science4DL workshop as follows.
#import \\"@preview/bloated-neurips:0.5.1\\": neurips\\n\\n#let get-notice(accepted) = if accepted == none {\\n return [Preprint. Under review.]\\n} else if accepted {\\n return [\\n Workshop on Scientific Methods for Understanding Deep Learning, NeurIPS\\n 2024.\\n ]\\n} else {\\n return [\\n Submitted to Workshop on Scientific Methods for Understanding Deep\\n Learning, NeurIPS 2024.\\n ]\\n}\\n\\n#let science4dl2024(\\n title: [], authors: (), keywords: (), date: auto, abstract: none,\\n bibliography: none, appendix: none, accepted: false, body,\\n) = {\\n show: neurips.with(\\n title: title,\\n authors: authors,\\n keywords: keywords,\\n date: date,\\n abstract: abstract,\\n accepted: false,\\n aux: (get-notice: get-notice),\\n )\\n body\\n}\\n
\\nThe biggest and the most important issues is related to line ruler. We are\\nnot aware of universal method for numbering lines in the main body of a\\npaper. Fortunately, line numbering support has been implemented at\\ntypst/typst#4516. Let\'s wait for the next major release v0.12.0!
\\nThere is an issue in Typst with spacing between figures and between figure\\nwith floating placement. The issue is that there is no way to specify gap\\nbetween subsequent figures. In order to have behaviour similar to original\\nLaTeX template, one should consider direct spacing adjacemnt with v(-1em)
\\nas follows.
#figure(\\n rect(width: 4.25cm, height: 4.25cm, stroke: 0.4pt),\\n caption: [Sample figure caption.#v(-1em)],\\n placement: top,\\n)\\n#figure(\\n rect(width: 4.25cm, height: 4.25cm, stroke: 0.4pt),\\n caption: [Sample figure caption.],\\n placement: top,\\n)\\n
\\nAnother issue is related to Typst\'s inablity to produce colored annotation.\\nIn order to mitigte the issue, we add a script which modifies annotations and\\nmake them colored.
\\n../colorize-annotations.py \\\\\\n example-paper.typst.pdf example-paper-colored.typst.pdf\\n
\\nSee README.md for details.
\\nNeurIPS 2023/2024 instructions discuss bibliography in vague terms. Namely,\\nthere is not specific requirements. Thus we stick to ieee
bibliography\\nstyle since we found it in several accepted papers and it is similar to that\\nin the example paper.
It is unclear how to render notice in the bottom of the title page in case of\\nfinal (accepted: true
) or preprint (accepted: none
) submission.
You can use this template in the Typst web app by clicking Start from\\ntemplate on the dashboard and searching for lucky-icml
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/lucky-icml\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the icml2024
function with the following named\\narguments.
title
: The paper\'s title as content.authors
: An array of author dictionaries. Each of the author dictionaries\\nmust have a name key and can have the keys department, organization,\\nlocation, and email.abstract
: The content of a brief summary of the paper or none. Appears at\\nthe top under the title.bibliography
: The result of a call to the bibliography function or none.\\nThe function also accepts a single, positional argument for the body of the\\npaper.accepted
: If this is set to false
then anonymized ready for submission\\ndocument is produced; accepted: true
produces camera-redy version. If\\nthe argument is set to none
then preprint version is produced (can be\\nuploaded to arXiv).The template will initialize your package with a sample call to the icml2024
\\nfunction in a show rule. If you want to change an existing project to use this\\ntemplate, you can add a show rule at the top of your file.
This template is developed at daskol/typst-templates repo. Please report\\nall issues there.
\\nfancyhdr
. But actual value is 3pt due to thickness of a ruler in 1pt.There is a small bug in CSL processor which fails to recognize bibliography\\nentries with chapter
field. It is already report and will be fixed in the\\nfuture.
There is no suitable bibliography style so we use default APA while ICML\\nrequires APA-like style but not exact APA. The difference is that ICML\\nAPA-like style places entry year at the end of reference entry. In order to\\nfix the issue, we need to describe ICML bibliography style in CSL-format.
\\nIn the original template links are colored with dark blue. We can reproduce\\nappearance with some additional effort. First of all, icml2024.csl
shoule\\nbe updated as follows.
diff --git a/icml/icml2024.csl b/icml/icml2024.csl\\nindex 3b9e9a2..3fe9f74 100644\\n--- a/icml/icml2024.csl\\n+++ b/icml/icml2024.csl\\n@@ -1648,7 +1648,8 @@\\n <key macro=\\"date-bib\\" sort=\\"ascending\\"/>\\n <key variable=\\"status\\"/>\\n </sort>\\n- <layout prefix=\\"(\\" suffix=\\")\\" delimiter=\\"; \\">\\n+ <!-- NOTE: Prefix and suffix parentheses are removed. --\x3e\\n+ <layout delimiter=\\"; \\">\\n <group delimiter=\\", \\">\\n <text macro=\\"author-intext\\"/>\\n <text macro=\\"date-intext\\"/>\\n
\\nThen instead of convenient citation shortcut @cite-key1 @cite-key2
, one\\nshould use special procedure refer
with variadic arguments.
#refer(<cite-key1>, <cite-key2>)\\n
\\nUtilities to write exams and exercises with integrated solutions. Set the variable #(cfg.sol = true)
to display the solutions of a document.
Currently the following features are supported:
\\n#points()
and #totalpoints()
functions.#checkbox(cfg, true)
.#lines(cfg, 3)
.#import \\"@local/tutor:0.6.1\\": points, totalpoints, lines, checkbox, default-config\\n\\n#let cfg = default-config()\\n// enable solution mode\\n#(cfg.sol = true)\\n\\n// display 3 lines (for hand written answer)\\n#lines(cfg, 3)\\n// checkbox for multiple choice (indicates correct state)\\n#checkbox(cfg, true)\\n\\n// show achievable points\\nMax. points: #points(2)\\nMax. points: #points(3)\\n// show sum of all total achievable points (will show 5)\\nTotal points: #totalpoints(cfg)\\n
\\nCheck example for a more practical example.
\\ntutor
is best used with the following directory and file structure:
├── main.typ\\n├── src\\n│ ├── ex1\\n│ │ └── ex.typ\\n│ └── ex2\\n│ └── ex.typ\\n└── tutor.toml\\n
\\nEvery directory in src
holds one self-contained exercise. The exercises can be imported into main.typ
:
#import \\"@local/tutor:0.6.1\\": totalpoints, lines, default-config\\n\\n#import \\"src/ex1/ex.typ\\" as ex1\\n#import \\"src/ex2/ex.typ\\" as ex2\\n\\n\\n#let cfg = default-config()\\n#ex1.exercise(cfg)\\n#ex2.exercise(cfg)\\n
\\nSupporting self-contained exercises is one of tutor
s primary design goals. Each exercise lives within a folder and can easily be copied or referenced in a new document.
An exercise is a folder that contains an ex.typ
file along with any other assets (images, source code aso). The following exercise shows a practical usage of the #checkbox()
and #points()
functions.
src/ex1/ex.typ
#import \\"@local/tutor:0.6.1\\": points, checkbox\\n\\n#let exercise(cfg) = [\\n#heading(level:cfg.lvl, [Abbreviation FHIR (#points(1) point)])\\n\\nWhat does FHIR stand for?\\n\\n#set list(marker: none)\\n- #checkbox(cfg, false) Finally He Is Real\\n- #checkbox(cfg, true) Fast Health Interoperability Resources\\n- #checkbox(cfg, false) First Health Inactivation Restriction\\n\\n#if cfg.sol {\\n [ Further explanation: FHIR is the new standard developed by HL7. ]\\n}\\n]\\n
\\nFinally this second example shows the #lines()
function.\\nsrc/ex2/ex.typ
#import \\"@local/tutor:0.6.1\\": points, lines \\n\\n#let exercise(cfg) = [\\n#heading(level:cfg.lvl, [FHIR vs HL7v2 (#points(4.5) points)])\\n\\nList two differences between HL7v2 and FHIR:\\n\\n+ #if cfg.sol { [ HL7v2 uses a non-standard line format, where as FHIR uses XML or JSON] } else { [ #lines(cfg, 3) ] }\\n+ #if cfg.sol { [ FHIR specifies various resources that can be queried, where as HL7v2 has a number of fixed fields that are either filled in or not]} else { [ #lines(cfg, 3) ] }\\n]\\n
\\nThis would then give the following output in question mode (#(cfg.sol=false)
)\\nand in solution mode (#(cfg.sol=true)
):\\n
#lines(cfg, count)
prints count
lines for students to write their answer.
Configuration:
\\n// Vertical line spacing between rows. \\n#(cfg.utils.lines.spacing = 8mm)\\n
\\n#grid(cfg, width, height)
prints a grid for students to write their answer.
Configuration:
\\n// Grid spacing. \\n#(cfg.utils.grid.spacing = 4mm)\\n
\\n#checkbox(cfg, answer)
shows a checkbox. In solution mode, the checkbox is shown filled out.
Configuration:
\\n// Symbol to show if answer is true \\n#(cfg.utils.checkbox.sym_true = \\"☒\\")\\n// Symbol to show if answer is false\\n#(cfg.utils.checkbox.sym_false = \\"☐\\")\\n// Symbol to show in question mode\\n#(cfg.utils.checkbox.sym_question = \\"☐\\")\\n
\\n#points(cfg, num)
displays the given num
while adding its value to the total points counter.
Configuration: none
\\n#totalpoints(cfg)
shows the final value of the total points counter.
Configuration:
\\n// If points() is used in the outline, totalpoints value becomes doubled.\\n// By setting outline to true, totalpoints gets divided by half.\\n#(cfg.utils.totalpoints.outline = false)\\n
\\ntutor
comes with a solution and a test mode.
Solution mode controls wheter solutions are shown or not. This mode controls eg. the utility #checkbox(cfg, answer)
.
(cfg.sol = false)
: Solutions are hidden. This is used for the actual exam handed out to students.(cfg.sol = true)
: Solutions are shown. This is used to create the exam solutions.You can also use the following helper functions:
\\nif-sol(cfg,[Content only shown in solution mode.])
if-sol-else(cfg,[Content only shown in solution mode.], [Content only shown in exam mode.])
Test mode can be used to show or hide additional information. In test mode, one might want
\\n(cfg.test = true)
: Test information are shown. Use this eg. to display #points(4)
. This is used in case the document is used as an exam/test.
(cfg.test = false)
: Test information are hidden. This is used in case the document is used as an excerise.
The following would show the points only in test mode.
\\n#if cfg.test {\\n #points(4)\\n}\\n
\\nOr you can use the following helper functions:
\\nif-test(cfg,[Content only shown in test mode.])
if-test-else(cfg,[Content only shown in test mode.], [Content only shown in exercise mode.])
tutor
is designed to create exams and solutions with one single document source. Furthermore, the individual utilities provided by tutor
can be configured. This can be done in one of three ways:
#default-config()
function and patch your configuration. The following example would configure the solution mode and basic line spacings to 8 millimeters:#let cfg = default-config()\\n#(cfg.sol = false)\\n#(cfg.utils.lines.spacing = 8mm)\\n
\\n#let cfg = toml(\\"tutor.toml\\")\\n
\\ntypst compile --input tutor_sol=true main.typ
#let cfg = toml(\\"tutor.toml\\")\\n\\n#if sys.inputs.tutor_sol == \\"true\\" {\\n (cfg.sol = true)\\n} else if sys.inputs.tutor_sol == \\"false\\" {\\n (cfg.sol = false)\\n}\\n
\\n","description":"Utilities to write exams and exercises with integrated solutions. Set the variable #(cfg.sol = true) to display the solutions of a document. Currently the following features are supported:\\n\\nAutomatic total point calculation through the #points() and #totalpoints() functions.\\nChe…","guid":"https://typst.app/universe/package/tutor","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-19T09:06:01.692Z","media":[{"url":"https://raw.githubusercontent.com/rangerjo/tutor/main/imgs/example_mod.png","type":"photo","width":950,"height":680}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"codelst (2.0.2) | A typst package to render sourcecode.","url":"https://typst.app/universe/package/codelst","content":"codelst is a Typst package for rendering sourcecode with line numbers and some other additions.
\\nImport the package from the typst preview repository:
\\n#import \\"@preview/codelst:2.0.2\\": sourcecode\\n
\\nAfter importing the package, simply wrap any fenced code block in a call to #sourcecode()
:
#import \\"@preview/codelst:2.0.2\\": sourcecode\\n\\n#sourcecode[```typ\\n#show \\"ArtosFlow\\": name => box[\\n #box(image(\\n \\"logo.svg\\",\\n height: 0.7em,\\n ))\\n #name\\n]\\n\\nThis report is embedded in the\\nArtosFlow project. ArtosFlow is a\\nproject of the Artos Institute.\\n```]\\n
\\nSee manual.pdf
for a comprehensive manual of the package.
See example.typ
for some quick usage examples.
The documentation is created using Mantys, a Typst template for creating package documentation.
\\nTo compile the manual, Mantys needs to be available as a local package. Refer to Mantys\' manual for instructions on how to do so.
\\nThis version makes codelst
compatible to Typst 0.11.0. Version 2.0.1 now requires Typst 0.11.0, since there are some breaking changes to the way counters work.
Thanks to @kilpkonn for theses changes.
\\nVersion 2 requires Typst 0.9.0 or newer. Rendering is now done using the new\\nraw.line
elements get consistent line numbers and syntax highlighting (even\\nif showrange
is used). Rendering is now done in a #table
.
theme
and syntaxes
options to overwrite passed in #raw
values.tab-indend
to tab-size
, to conform with the Typst option.continue-numbering
option for now. (The feature failed in combination with label parsing and line highlights.)show
-rule.#sourcecode()
:\\nlang
: Overwrite code language setting.numbers-first
: First line number to show.numbers-step
: Only show every n-th number.frame
: Set a frame (replaces <codelst>
label.)line-numbers
and numbering
options.#numbers-style()
function.\\nnumbers-style
option now gets passed counter.display()
.<codelst>
label.codelst-style
only sets breakable
for figures.codelst
function to setup a catchall show rules for raw
text.label-regex: none
disables labels parsing.numbers-width
option to manually set width of line numbers column.\\nnumbers-width
to 0pt
or a negative number like -1em
.#read()
from #sourcefile()
.continue-numbering
argument to #sourcecode()
.showrange
having out of range line numbers.lang
attribute in raw
element.Create simple static slides with Typst.
\\nSlydst allows the creation of slides using Typst headings.\\nThis simplicity comes at the expense of dynamic content such as subslide animations.\\nFor more complete and complex slides functionalities, see other tools such as Polylux.
\\nTo start, just use the following preamble (only the title is required).
\\n#import \\"@preview/slydst:0.1.1\\": *\\n\\n#show: slides.with(\\n title: \\"Insert your title here\\", // Required\\n subtitle: none,\\n date: none,\\n authors: (),\\n layout: \\"medium\\",\\n ratio: 4/3,\\n title-color: none,\\n)\\n\\nInsert your content here.\\n
\\nThen, insert your content.
\\n#v(1fr)
.== Outline\\n\\n#outline()\\n\\n= First section\\n\\n== First slide\\n\\n#figure(image(\\"figure.png\\", width: 60%), caption: \\"Caption\\")\\n\\n#v(1fr)\\n\\n#lorem(20)\\n
\\nDefinitions, theorems, lemmas, corollaries and algorithms boxes are also available.
\\n#definition(title: \\"An interesting definition\\")[\\n #lorem(20)\\n]\\n
\\nslides
content
: content
- content of the presentationtitle
: str
- title (required)subtitle
: str
- subtitledate
: str
- dateauthors
: array
of content
or content
- list of authors or author contentlayout
: str in (\\"small\\", \\"medium\\", \\"large\\")
- layout selectionratio
: float
or ratio
or int
- width to height ratiotitle-color
: color
or gradient
- color of title and headingsdefinition
, theorem
, lemma
, corollary
, algorithm
content
: content
- content of the blocktitle
: str
- title of the block
CeTZ (CeTZ, ein Typst Zeichenpaket) is a library for drawing with Typst with an API inspired by TikZ and Processing.
\\n\\n \\n ![]() | \\n \\n \\n ![]() | \\n \\n \\n ![]() | \\n
Karl\'s Picture | \\nTree Layout | \\nWaves | \\n
Click on the example image to jump to the code.
\\nFor information, see the online manual.
\\nTo use this package, simply add the following code to your document:
\\n#import \\"@preview/cetz:0.3.1\\"\\n\\n#cetz.canvas({\\n import cetz.draw: *\\n // Your drawing code goes here\\n})\\n
\\nTo install the CeTZ package under your local typst package dir you can use the install
script from the repository.
just install\\n
\\nThe installed version can be imported by prefixing the package name with @local
.
#import \\"@local/cetz:0.3.1\\"\\n\\n#cetz.canvas({\\n import cetz.draw: *\\n // Your drawing code goes here\\n})\\n
\\nThis project uses just, a handy command runner.
\\nYou can run all commands without having just
installed, just have a look into the justfile
.\\nTo install just
on your system, use your systems package manager. On Windows, Cargo (cargo install just
), Chocolatey (choco install just
) and some other sources can be used. You need to run it from a sh
compatible shell on Windows (e.g git-bash).
This package comes with some unit tests under the tests
directory.\\nTo run all tests you can run the just test
target. You need to have\\ntypst-test
in your PATH
: cargo install typst-test --git https://github.com/tingerrr/typst-test
.
Run python code in typst using RustPython.
\\n#import \\"@preview/pyrunner:0.1.0\\" as py\\n\\n#let compiled = py.compile(\\n```python\\ndef find_emails(string):\\n import re\\n return re.findall(r\\"\\\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,}\\\\b\\", string)\\n\\ndef sum_all(*array):\\n return sum(array)\\n```)\\n\\n#let txt = \\"My email address is john.doe@example.com and my friend\'s email address is jane.doe@example.net.\\"\\n\\n#py.call(compiled, \\"find_emails\\", txt)\\n#py.call(compiled, \\"sum_all\\", 1, 2, 3)\\n
\\nBlock mode is also available.
\\n#let code = ```\\nf\'{a+b=}\'\\n```\\n\\n#py.block(code, globals: (a: 1, b: 2))\\n\\n#py.block(code, globals: (a: \\"1\\", b: \\"2\\"))\\n
\\nThe result will be a+b=3
and a+b=\'12\'
.
Due to restrictions of typst and its plugin system, some Python function will not work as expected:
\\ndatatime.now
will always return 1970-01-01.Also, there is no way to import third-party modules. Only bundled stdlib modules are available. We might find a way to lift this restriction, so feel free to submit an issue if you want this functionality.
\\nblock
Run Python code block and get its result.
\\ncode
: string | raw content - The Python code to run.globals
: dict (named optional) - The global variables to bring into scope.The last expression of the code block.
\\ncompile
Compile Python code to bytecode.
\\ncode
: string | raw content - The Python code to compile.The bytecode representation in bytes
.
call
Call a python function with arguments.
\\ncompiled
: bytes - The bytecode representation of Python code.fn_name
: string - The name of the function to be called...args
: any - The arguments to pass to the function.The result of the function call.
\\nInstall wasi-stub
. You should use a slightly modified one. See the related issue.
Build pyrunner.
\\nrustup target add wasm32-wasi\\ncargo build --target wasm32-wasi\\nmake pkg/typst-pyrunner.wasm\\n
\\nAdd to local package.
\\nmkdir -p ~/.local/share/typst/packages/local/pyrunner/0.0.1\\ncp pkg/* ~/.local/share/typst/packages/local/pyrunner/0.0.1\\n
\\n","description":"Run python code in typst using RustPython. #import \\"@preview/pyrunner:0.1.0\\" as py\\n\\n#let compiled = py.compile(\\n```python\\ndef find_emails(string):\\n import re\\n return re.findall(r\\"\\\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,}\\\\b\\", string)\\n\\ndef sum_all(*array):\\n return…","guid":"https://typst.app/universe/package/pyrunner","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-18T09:14:36.158Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"colorful-boxes (1.3.1) | Predefined colorful boxes to spice up your document.","url":"https://typst.app/universe/package/colorful-boxes","content":"Colorful boxes in Typst.
\\nCheck out the example project to see all boxes in action
\\nCurrent features include:
\\n#colorbox(\\n title: lorem(5),\\n color: \\"blue\\",\\n radius: 2pt,\\n width: auto\\n)[\\n #lorem(50)\\n]\\n
\\n#slanted-colorbox(\\n title: lorem(5),\\n color: \\"red\\",\\n radius: 0pt,\\n width: auto\\n)[\\n #lorem(50)\\n]\\n
\\n#outlinebox(\\n title: lorem(5),\\n width: auto,\\n radius: 2pt,\\n centering: false\\n)[\\n #lorem(50)\\n]\\n\\n#outlinebox(\\n title: lorem(5),\\n color: \\"green\\",\\n width: auto,\\n radius: 2pt,\\n centering: true\\n)[\\n #lorem(50)\\n]\\n
\\n#stickybox(\\n rotation: 5deg,\\n width: 5cm\\n)[\\n #lorem(20)\\n]\\n
\\n","description":"Colorful boxes in Typst. Check out the example project to see all boxes in action\\n\\nCurrent features include:\\n\\na colorful box is in four different colors (black, red, blue, green)\\na colorful box with a slanted headline\\na box with a simple outline\\na rotateable stickynote\\nColorbox…","guid":"https://typst.app/universe/package/colorful-boxes","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-16T09:12:57.156Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/colorful-boxes/1.3.1/examples/colorbox.png","type":"photo","width":1191,"height":217},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/colorful-boxes/1.3.1/examples/slanted-colorbox.png","type":"photo","width":1191,"height":217},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/colorful-boxes/1.3.1/examples/outline-colorbox.png","type":"photo","width":1191,"height":373},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/colorful-boxes/1.3.1/examples/stickybox.png","type":"photo","width":340,"height":255}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"drafting (0.2.0) | Helpful functions for content positioning and margin comments/notes","url":"https://typst.app/universe/package/drafting","content":"drafting
exists in the official typst package repository, so the\\nrecommended approach is to import it from the preview
namespace:
#import \\"@preview/drafting:0.2.0\\"\\n
\\nMargin notes cannot lay themselves out correctly until they know your\\npage size and margins. To this end, make sure call\\n#set-page-properties()
after configuring your page size/margins:
// Of course, you can set whatever margin values you prefer\\n#set page(\\n margin: (right: 2in), paper: \\"us-letter\\"\\n)\\n\\n// This is important! Call it whenever your page is reconfigured.\\n#set-page-properties()\\n
\\nNote: drafting
does not yet support inside
/outside
margins. Follow\\nhttps://github.com/typst/typst/issues/3636 for updates.
\\n
#lorem(20)\\n#margin-note(side: left)[Hello, world!]\\n#lorem(10)\\n#margin-note[Hello from the other side]\\n#margin-note[When notes are about to overlap, they\'re automatically shifted]\\n#margin-note(stroke: aqua + 3pt)[To avoid collision]\\n#lorem(25)\\n#margin-note(stroke: green, side: left)[You can provide two positional arguments if you want to highlight a phrase associated with your note.][The first is text which should be inline-noted, and the second is the standard margin note.]\\n\\n#let caution-rect = rect.with(inset: 1em, radius: 0.5em, fill: orange.lighten(80%))\\n#inline-note(rect: caution-rect)[\\n Be aware that `typst` will complain when 4 notes overlap, and stop automatically avoiding collisions when 5 or more notes\\n overlap. This is because the compiler stops attempting to reposition notes after a few attempts\\n (initial layout + adjustment for each note).\\n\\n You can manually adjust the position of notes with `dy` to silence the warning.\\n]\\n
\\nAll function defaults are customizable through updating the module\\nstate:
\\n\\n
#lorem(14) #margin-note[Default style]\\n#lorem(10)\\n#set-margin-note-defaults(stroke: orange, side: left)\\n#margin-note[Updated style]\\n#lorem(10)\\n
\\nEven deeper customization is possible by overriding the default rect
:
\\n
#import \\"@preview/colorful-boxes:1.1.0\\": stickybox\\n\\n#let default-rect(stroke: none, fill: none, width: 0pt, content) = {\\n set text(0.9em)\\n stickybox(rotation: 30deg, width: width/1.5, content)\\n}\\n#set-margin-note-defaults(rect: default-rect, stroke: none, side: right)\\n\\n#lorem(20)\\n#margin-note(dy: -5em)[Why not use sticky notes in the margin?]\\n\\n// Undo changes from this example\\n#set-margin-note-defaults(rect: rect, stroke: red)\\n
\\n\\n
#let reviewer-a = margin-note.with(stroke: blue)\\n#let reviewer-b = margin-note.with(stroke: purple)\\n#lorem(10)\\n#reviewer-a[Comment from reviewer A]\\n#lorem(5)\\n#reviewer-b(side: left)[Reviewer B comment]\\n#lorem(10)\\n
\\n\\n
#lorem(10)\\n#inline-note[The default inline note will split the paragraph at its location]\\n#lorem(10)\\n#inline-note(par-break: false, stroke: (paint: orange, dash: \\"dashed\\"))[\\n But you can specify `par-break: false` to prevent this\\n]\\n#lorem(10)\\n
\\n\\n
#set-margin-note-defaults(hidden: true)\\n\\n#lorem(20)\\n#margin-note[This will respect the global \\"hidden\\" state]\\n#margin-note(hidden: false, dy: -2.5em)[This note will never be hidden]\\n// Undo these changes\\n#set-margin-note-defaults(hidden: false)\\n
\\nNeed to measure space for fine-tuned positioning? You can use\\nrule-grid
to cross-hatch the page with rule lines:
\\n
#rule-grid(width: 10cm, height: 3cm, spacing: 20pt)\\n#place(\\n dx: 180pt,\\n dy: 40pt,\\n rect(fill: white, stroke: red, width: 1in, \\"This will originate at (180pt, 40pt)\\")\\n)\\n\\n// Optionally specify divisions of the smallest dimension to automatically calculate\\n// spacing\\n#rule-grid(dx: 10cm + 3em, width: 3cm, height: 1.2cm, divisions: 5, square: true, stroke: green)\\n\\n// The rule grid doesn\'t take up space, so add it explicitly\\n#v(3cm + 1em)\\n
\\nWhat about absolutely positioning something regardless of margin and\\nrelative location? absolute-place
is your friend. You can put content\\nanywhere:
\\n
#context {\\n let (dx, dy) = (here().position().x, here().position().y)\\n let content-str = (\\n \\"This absolutely-placed box will originate at (\\" + repr(dx) + \\", \\" + repr(dy) + \\")\\"\\n + \\" in page coordinates\\"\\n )\\n absolute-place(\\n dx: dx, dy: dy,\\n rect(\\n fill: green.lighten(60%),\\n radius: 0.5em,\\n width: 2.5in,\\n height: 0.5in,\\n [#align(center + horizon, content-str)]\\n )\\n )\\n}\\n#v(0.5in)\\n
\\nThe “rule-grid” also supports absolute placement at the top-left of the\\npage by passing relative: false
. This is helpful for “rule“-ing the\\nwhole page.
Automagic tools to smooth the package documentation & development\\nprocess.
\\nPackage your files for local typst installation or PR submission in\\none command
\\nProvide your readme in typst format with code block examples, and let\\nshowman
do the rest! In one command, it will the readme to markdown\\nand render code block outputs as included images.
showman
know your repository path and it will\\nensure images will properly appear in your readme even after your\\npackage has been distributed through typst’s registry.Execute non-typst code blocks and render their outputs
\\nPrerequisites: Make sure you have typst
and pandoc
available\\nfrom the command line. Then, in a python virtual environment, run:
pip install showman\\n
\\nCreate a typst file with ```example
code blocks that show the\\noutput you want to include in your readme. For instance:
#import \\"@preview/cetz:0.1.2\\"\\n// Just to avoid showing this heading in the readme itself\\n#set heading(outlined: false)\\n\\n= Hello, world!\\nLet\'s do something complicated:\\n\\n#cetz.canvas({\\n import cetz.plot\\n import cetz.palette\\n cetz.draw.set-style(axes: (tick: (length: -.05)))\\n // Plot something\\n plot.plot(size: (3,3), x-tick-step: 1, axis-style: \\"left\\", {\\n for i in range(0, 3) {\\n plot.add(domain: (-4, 2),\\n x => calc.exp(-(calc.pow(x + i, 2))),\\n fill: true, style: palette.tango)\\n }\\n })\\n})\\n
\\nThen, run the following command:
\\nshowman md <path-to-typst-file>\\n
\\nCongrats, you now have a readme with inline images 🎉
\\nYou can optionally specify your workspace root, output file name, image\\nfolder, etc. These options are visible under showman md --help
.
Note: You can customize the appearance of these images by providing\\nshowman
the template to use when creating them. In your file to be\\nrendered, create a variable called showman-config
at the outermost\\nscope:
// Render images with a black background and red text\\n#let showman-config = (\\n template: it => {\\n set text(fill: red)\\n rect(fill: black, it)\\n }\\n)\\n
\\nBehind the scenes, showman imports your file as a module and looks for\\nthis variable. If it is found, your template and a few other options are\\ninjected into the example rendering process.
\\nNote: If every example has the same setup (package imports, etc.),\\nand you don’t want the text to be included in your examples, you can\\npass eval-kwargs
in this config as well to specify a string that gets\\nprefixed to every example. Alternatively, pass variables in a scope\\ndirectly:
// Setup either through providing scope or import prefixes\\n#let my-variable = 5\\n#let showman-config = (\\n eval-kwargs: (\\n prefix: \\"#import \\\\\\"@preview/cetz:0.1.2\\\\\\"\\n ),\\n // Now you can use `my-var` in your examples\\n scope: (my-var: my-variable)\\n)\\n
\\nshowman
uses the beautiful pandoc
to do most of the markdown\\nconversion heavy lifting. So, if your document can’t be processed by\\npandoc, you may need to adjust your syntax until pandoc is happy\\nmaking a markdown document.
Typst doesn’t allow page styling inside containers. Since showman
\\nmust use containers to extract each rendered example, you can’t use\\n#set page(...)
or #pagebreak()
inside your examples.
If you don’t care about converting your readme to markdown, it’s even\\neasier to have example rendered alongside their code. Simply add the\\nfollowing preamble to your file:
\\n#import \\"@preview/showman:0.1.1\\"\\n#show: showman.formatter.template\\n\\nThe code below will be rendered side by side with its output:\\n\\n``` typst\\n= Hello world!\\n```\\n\\n\\nSeveral keywords can be privded to customize appearance and more. See `showman.formatter.template` for more details.\\n
\\nYou’ve done the hard work of creating a beautiful, well-documented\\nmanual. Now it’s time to share it with the world. showman
can help you\\npackage your files for distribution in one command, after some minimal\\nsetup.
Make sure you have a typst.toml
file that follows typst packaging\\nguidelines
Add a new block to your toml file as follows:
\\n[tool.packager]\\npaths = [...]\\n
\\nWhere paths
is a list of files and directories you want to include in\\nyour package.
showman package <path-to-toml-file>\\n
\\nWithout any other arguments, you’ve just installed your package in\\nyour system’s local typst packages folder. Now you can import it\\nwith typst #import \\"@local/mypackage:<version>\\"
.
typst/packages
to prep your files for a PR, or specify a\\n--namespace
other than local
.Note: You can see the full list of command options with\\nshowman package --help
.
This package also executes non-typst code (currently bash on\\nnon-windows, python, and c++). You can use\\nshowman execute ./path/to/file.typ
to execute code blocks in these\\nlanguages, and the output will be captured in a .coderunner.json
file\\nin the root directory you specified. To enable this feature, you need to\\nadd the following preamble to your file:
#import \\"@preview/showman:0.1.1\\": runner\\n\\n#let cache = json(\\"/.coderunner.json\\").at(\\"path/to/file.typ\\", default: (:))\\n#let show-rule = runner.external-code.with(result-cache: cache)\\n\\n// Now, apply the show rule to languages that have a `showman execute` result:\\n#show raw.where(lang: \\"python\\"): show-rule\\n
\\nYou can optionally style <example-input>
and <example-output>
labels\\nto customize how input and output blocks appear. For even deeper\\ncustomization, you can specify the container
that displays the input\\nand output blocks that accepts a keyword direction
and positional\\ninput
and output
.
serialize the Typst objects into bytes and deserialize the bytes into Typst objects
\\nI want to interactive between the wasm and typst. But I found that the input arguments and output argument are all bytes. It is not convenient for me to use WASM. So I designed the serialization protocol and implemented this serialization module for reference.
\\nAlthough there have been some serialization APIs like cbor, yaml, json and others, this is a good learning material and a good example to show the abilities of Typst.
\\nHave a look at the example here.
\\nSimply import 2 functions : serialize
, deserialize
.
And enjoy it
\\n#import \\"@preview/yats:0.1.0\\": serialize, deserialize\\n#{\\n let obj = (\\n name : \\"0warning0error\\",\\n age : 100,\\n height : 1.8,\\n birthday : datetime(year : 1998,month : 7,day:8)\\n )\\n deserialize(serialize(obj))\\n}\\n
\\nnone
bool
type
: type is a typeint
float
: (implemented in string, for convenience)datetime
: only support year
,month
,day
; hour
, minute
,second
; both combined.duration
bytes
string
regex
: (dealing with it is a little tricky)array
: the element in it can be anything listed.dictionary
: the value in it can be anything listed.Yats
function#let serialize(\\n data : any\\n) = { .. }\\n
\\nArguments:
\\ndata
: [any
] — Any supported object .Return
\\nThe serialized bytes.
\\n#let deserialize(\\n data : array\\n) = { .. }\\n
\\nArguments:
\\ndata
: [bytes
] — serialized objects represented by bytes .Return
\\nbinary array. (the first one is the object deserialized, the second one is the valid length of the bytes)
\\nSome problem can be caused by changes of repr
. For example, the serialization of regex
relies on the repr
of regex
. And there are no method to directly catch the inner string
.
Because of lack of time, only basic types are supported. But more types can be supported in Typst.
\\nThis project is licensed under the Apache 2.0 License.
\\n","description":"serialize the Typst objects into bytes and deserialize the bytes into Typst objects Reason\\n\\nI want to interactive between the wasm and typst. But I found that the input arguments and output argument are all bytes. It is not convenient for me to use WASM. So I designed the…","guid":"https://typst.app/universe/package/yats","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-15T09:33:26.458Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"rose-pine (0.2.0) | Soho vibes for Typst in a form of easily applicable theme.","url":"https://typst.app/universe/package/rose-pine","content":"\\n \\n
All natural pine, faux fur and a bit of soho vibes for the classy minimalist
\\n\\n \\n \\n \\n
#import \\"@preview/rose-pine:0.2.0\\": apply\\n
\\n#show
:#show: apply()\\n
\\n#import \\"@preview/rose-pine:0.2.0\\": rose-pine\\n\\n#text(fill: rose-pine.love)[Some red text]\\n
\\nYou can also use other variants by importing them/passing their name to apply()
. E.g.
#import \\"@preview/rose-pine:0.2.0\\": apply, rose-pine-dawn\\n#show: apply(variant: \\"rose-pine-dawn\\")\\n
\\n\\n\\nPrefer using @rose-pine/build when possible
\\n
Modify src/template.typ
using Rosé Pine variables, then build variants:
npx @rose-pine/build@0.8.2 -t src/template.typ -o src/themes -p $ -f hex\\n
\\nGenerated by @rose-pine/build@0.8.2
\\n\\nTo rebuild the syntax highlighting themes you similarly need to run
\\nnpx @rose-pine/build@0.8.2 -t src/rose-pine-template.tmTheme -o src/themes -p $ -f hex --help\\n
\\n","description":"Rosé Pine for Typst All natural pine, faux fur and a bit of soho vibes for the classy minimalist\\n\\nUsage\\nOpen a Typst document\\nImport this library:\\n#import \\"@preview/rose-pine:0.2.0\\": apply\\n\\nApply the theme to the document using #show:\\n#show…","guid":"https://typst.app/universe/package/rose-pine","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-12T10:24:10.482Z","media":[{"url":"https://raw.githubusercontent.com/rose-pine/rose-pine-theme/raw/main/assets/icon.png","type":"photo","width":80},{"url":"https://img.shields.io/badge/community-ros%C3%A9%20pine-26233a?labelColor=191724&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjUwIiBoZWlnaHQ9IjIzNyIgdmlld0JveD0iMCAwIDI1MCAyMzciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xNjEuMjI3IDE2MS4yNTFDMTMyLjE1NCAxNjkuMDQxIDExNC45MDEgMTk4LjkyNCAxMjIuNjkxIDIyNy45OTdDMTIzLjkyNSAyMzIuNjAzIDEyOC42NTkgMjM1LjMzNiAxMzMuMjY0IDIzNC4xMDJMMTg1LjkwNyAyMTkuOTk2QzIxOS41ODUgMjEwLjk3MiAyMzkuNTcgMTc2LjM1NCAyMzAuNTQ2IDE0Mi42NzdMMTYxLjIyNyAxNjEuMjUxWiIgZmlsbD0iIzI0NjI3QiIvPgo8cGF0aCBkPSJNODguMTgzNiAxNTkuOTg4QzExNy4yNTcgMTY3Ljc3OCAxMzQuNTEgMTk3LjY2MiAxMjYuNzIgMjI2LjczNUMxMjUuNDg2IDIzMS4zNCAxMjAuNzUyIDIzNC4wNzMgMTE2LjE0NyAyMzIuODM5TDYzLjUwNDEgMjE4LjczM0MyOS44MjY0IDIwOS43MSA5Ljg0MDk0IDE3NS4wOTIgMTguODY0OSAxNDEuNDE0TDg4LjE4MzYgMTU5Ljk4OFoiIGZpbGw9IiMyNDYyN0IiLz4KPHBhdGggZD0iTTE4Ni44NjcgMTcyLjk4QzE1Mi4wMDIgMTcyLjk4IDEyMy43MzcgMjAxLjI0NSAxMjMuNzM3IDIzNi4xMTFIMTg2Ljg3QzIyMS43MzYgMjM2LjExMSAyNTAgMjA3Ljg0NiAyNTAgMTcyLjk4TDE4Ni44NjcgMTcyLjk4WiIgZmlsbD0iIzMxNzQ4RiIvPgo8cGF0aCBkPSJNNjMuMTMyNyAxNzIuOThDOTcuOTk4NCAxNzIuOTggMTI2LjI2MyAyMDEuMjQ1IDEyNi4yNjMgMjM2LjExMUg2My4xM0MyOC4yNjQyIDIzNi4xMTEgLTEuNTI0MDNlLTA2IDIwNy44NDYgMCAxNzIuOThMNjMuMTMyNyAxNzIuOThaIiBmaWxsPSIjMzE3NDhGIi8+CjxwYXRoIGQ9Ik0xNzEuNzE3IDc1LjEyNjNDMTcxLjcxNyAxMDEuMjc2IDE1MC41MTggMTIyLjQ3NSAxMjQuMzY5IDEyMi40NzVDOTguMjE4OCAxMjIuNDc1IDc3LjAyMDIgMTAxLjI3NiA3Ny4wMjAyIDc1LjEyNjNDNzcuMDIwMiA0OC45NzY0IDk4LjIxODggMjcuNzc3OCAxMjQuMzY5IDI3Ljc3NzhDMTUwLjUxOCAyNy43Nzc4IDE3MS43MTcgNDguOTc2NCAxNzEuNzE3IDc1LjEyNjNaIiBmaWxsPSIjRUJCQ0JBIi8+CjxwYXRoIGQ9Ik0xNDQuMjE3IDg2LjIzNzlDMTYxLjY0OSA1Ni4wNDMyIDE1MS4zMDMgMTcuNDMyOSAxMjEuMTA4IDBMMTA2LjA2IDI2LjA2NDRDODguNjI3IDU2LjI1OSA5OC45NzM2IDk0Ljg2OTQgMTI5LjE2OCAxMTIuMzAyTDE0NC4yMTcgODYuMjM3OVoiIGZpbGw9IiNFQkJDQkEiLz4KPHBhdGggZD0iTTEyNS4yOTkgNjAuOTc4OUMxMTYuMjc1IDI3LjMwMTIgODEuNjU3NSA3LjMxNTY3IDQ3Ljk3OTcgMTYuMzM5Nkw2NC4zMTk3IDc3LjMyMTFDNzMuMzQzNiAxMTAuOTk5IDEwNy45NjEgMTMwLjk4NCAxNDEuNjM5IDEyMS45NkwxMjUuMjk5IDYwLjk3ODlaIiBmaWxsPSIjRUJCQ0JBIi8+CjxwYXRoIGQ9Ik0xMjQuOTI2IDYwLjk3ODlDMTMzLjk1IDI3LjMwMTIgMTY4LjU2NyA3LjMxNTY3IDIwMi4yNDUgMTYuMzM5NkwxODUuOTA1IDc3LjMyMTFDMTc2Ljg4MSAxMTAuOTk5IDE0Mi4yNjMgMTMwLjk4NCAxMDguNTg2IDEyMS45NkwxMjQuOTI2IDYwLjk3ODlaIiBmaWxsPSIjRUJCQ0JBIi8+Cjwvc3ZnPgo=&style=for-the-badge","type":"photo","width":211,"height":28},{"url":"https://github.com/oplik0/rose-pine-typst/assets/25460763/0f3f4c3a-a923-4587-bd80-92e60165dc7e","type":"photo","width":1410,"height":1228},{"url":"https://github.com/oplik0/rose-pine-typst/assets/25460763/9b842b68-4f57-4536-955f-7f510b77a579","type":"photo","width":1410,"height":1233},{"url":"https://github.com/oplik0/rose-pine-typst/assets/25460763/5b2d211d-d645-4b72-9b58-b73bccfae1ae","type":"photo","width":1410,"height":1236}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"note-me (0.3.0) | Adds GitHub-style Admonitions (Alerts) to Typst.","url":"https://typst.app/universe/package/note-me","content":"\\n\\n[!NOTE]\\nAdd GitHub style admonitions (also known as alerts) to Typst.
\\n
Import this package, and do
\\n// Import from @preview namespace is suggested\\n// #import \\"@preview/note-me:0.3.0\\": *\\n\\n// Import from @local namespace is only for debugging purpose\\n// #import \\"@local/note-me:0.3.0\\": *\\n\\n// Import relatively is for development purpose\\n#import \\"lib.typ\\": *\\n\\n= Basic Examples\\n\\n#note[\\n Highlights information that users should take into account, even when skimming.\\n]\\n\\n#tip[\\n Optional information to help a user be more successful.\\n]\\n\\n#important[\\n Crucial information necessary for users to succeed.\\n]\\n\\n#warning[\\n Critical content demanding immediate user attention due to potential risks.\\n]\\n\\n#caution[\\n Negative potential consequences of an action.\\n]\\n\\n#admonition(\\n icon-path: \\"icons/stop.svg\\",\\n color: color.fuchsia,\\n title: \\"Customize\\",\\n foreground-color: color.white,\\n background-color: color.black,\\n)[\\n The icon, (theme) color, title, foreground and background color are customizable.\\n]\\n\\n#admonition(\\n icon-string: read(\\"icons/light-bulb.svg\\"),\\n color: color.fuchsia,\\n title: \\"Customize\\",\\n)[\\n The icon can be specified as a string of SVG. This is useful if the user want to use an SVG icon that is not available in this package.\\n]\\n\\n#admonition(\\n icon: [🙈],\\n color: color.fuchsia,\\n title: \\"Customize\\",\\n)[\\n Or, pass a content directly as the icon...\\n]\\n\\n= More Examples\\n\\n#todo[\\n Fix `note-me` package.\\n]\\n\\n\\n= Prevent Page Breaks from Breaking Admonitions\\n\\n#box(\\n width: 1fr,\\n height: 50pt,\\n fill: gray,\\n)\\n\\n#note[\\n #lorem(100)\\n]\\n
\\nFurther Reading:
\\nIt borrows the style of GitHub\'s admonition.
\\n\\n\\n[!NOTE]
\\n
\\nHighlights information that users should take into account, even when skimming.
\\n\\n[!TIP]\\nOptional information to help a user be more successful.
\\n
\\n\\n[!IMPORTANT]
\\n
\\nCrucial information necessary for users to succeed.
\\n\\n[!WARNING]
\\n
\\nCritical content demanding immediate user attention due to potential risks.
\\n\\n[!CAUTION]\\nNegative potential consequences of an action.
\\n
The admonition icons are from Octicons.
\\n","description":"[!NOTE] Add GitHub style admonitions (also known as alerts) to Typst. Usage\\n\\nImport this package, and do\\n\\n// Import from @preview namespace is suggested\\n// #import \\"@preview/note-me:0.3.0\\": *\\n\\n// Import from @local namespace is only for debugging purpose\\n// #import \\"@local/note…","guid":"https://typst.app/universe/package/note-me","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-08T22:58:10.451Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/note-me/0.3.0/example.svg","type":"photo","width":0,"height":0,"blurhash":""}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"badformer (0.1.0) | Retro-gaming in Typst. Reach the goal and complete the mission.","url":"https://typst.app/universe/package/badformer","content":"Reach the goal in this retro-inspired wireframing platformer. Play in 3\\ndimensions and compete for the lowest number of steps to win!
\\nThis small game is playable in the Typst editor and best enjoyed with the web\\napp or typst watch
. It was first released for the 24 Days to Christmas\\ncampaign in winter of 2023.
You can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for badformer
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/badformer\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nMove with WASD and jump with space. You can also display a minimap by pressing\\nE.
\\nThis template exports the game
function, which accepts a positional argument\\nfor the game input.
The template will initialize your package with a sample call to the game
\\nfunction in a show rule. If you want to change an existing project to use this\\ntemplate, you can add a show rule like this at the top of your file:
#import \\"@preview/badformer:0.1.0\\": game\\n#show: game(read(\\"main.typ\\"))\\n\\n// Move with WASD and jump with space.\\n
\\n","description":"Reach the goal in this retro-inspired wireframing platformer. Play in 3 dimensions and compete for the lowest number of steps to win! This small game is playable in the Typst editor and best enjoyed with the web app or typst watch. It was first released for the 24 Days to…","guid":"https://typst.app/universe/package/badformer","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-06T11:03:09.905Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"icicle (0.1.0) | Help the Typst Guys reach the helicopter pad and save Christmas!","url":"https://typst.app/universe/package/icicle","content":"Help the Typst Guys reach the helicopter pad and save Christmas! Navigate them\\nwith the WASD keys and solve puzzles with snowballs to make way for the Typst\\nGuys.
\\nThis small Christmas-themed game is playable in the Typst editor and best\\nenjoyed with the web app or typst watch
. It was first released for the 24 Days\\nto Christmas campaign in winter of 2023.
You can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for icicle
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/icicle\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the game
function, which accepts a positional argument for the game input.
The template will initialize your package with a sample call to the game
\\nfunction in a show rule. If you want to change an existing project to use this\\ntemplate, you can add a show rule like this at the top of your file:
#import \\"@preview/icicle:0.1.0\\": game\\n#show: game\\n\\n// Move with WASD.\\n
\\nYou can also add your own levels by adding an array of level definition strings\\nin the game
function\'s named levels
argument. Each level file must conform\\nto the following format:
The three arguments must be separated by double newlines. Additionally, each\\nrow in the matrices space-separates its values. Newlines terminate the rows.\\nComments can be added with a double slash. Find an example for a valid level\\nstring below:
\\n// The starting position\\n0, 0\\n\\n// The back layer\\nf f f w f f f\\nf f f w f f f\\nf f x w f f f\\nf f f w f f f\\nf f f w f x x\\nx x x g x x x\\n\\n// The front layer.\\n_ _ b _ _ _ _\\n_ _ b _ _ _ _\\n_ _ _ _ b _ _\\n_ _ _ _ b _ _\\n_ _ _ _ _ _ _\\n_ _ _ _ _ _ _\\n
\\nIt\'s best to put levels into separate files and load them with the read
\\nfunction.
A basic letter with sender and recipient address. The letter is ready for a DIN DL windowed envelope.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for appreciated-letter
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/appreciated-letter\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the letter
function with the following named arguments:
sender
: The letter\'s sender as content. This is displayed at the top of the page.recipient
: The address of the letter\'s recipient as content. This is displayed near the top of the page.date
: The date, and possibly place, the letter was written at as content. Flushed to the right after the address.subject
: The subject line for the letter as content.name
: The name the letter closes with as content.The function also accepts a single, positional argument for the body of the\\nletter.
\\nThe template will initialize your package with a sample call to the letter
\\nfunction in a show rule. If you, however, want to change an existing project to\\nuse this template, you can add a show rule like this at the top of your file:
#import \\"@preview/appreciated-letter:0.1.0\\": letter\\n\\n#show: letter.with(\\n sender: [\\n Jane Smith, Universal Exports, 1 Heavy Plaza, Morristown, NJ 07964\\n ],\\n recipient: [\\n Mr. John Doe \\\\\\n Acme Corp. \\\\\\n 123 Glennwood Ave \\\\\\n Quarto Creek, VA 22438\\n ],\\n date: [Morristown, June 9th, 2023],\\n subject: [Revision of our Producrement Contract],\\n name: [Jane Smith \\\\ Regional Director],\\n)\\n\\nDear Joe,\\n\\n#lorem(99)\\n\\nBest,\\n
\\n","description":"A basic letter with sender and recipient address. The letter is ready for a DIN DL windowed envelope. Usage\\n\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the dashboard and searching for appreciated-letter.\\n\\nAlternatively, you can use the CLI…","guid":"https://typst.app/universe/package/appreciated-letter","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-06T11:03:09.216Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"dashing-dept-news (0.1.1) | Share the news with bold graphic design and a modern layout","url":"https://typst.app/universe/package/dashing-dept-news","content":"A fun newsletter layout for departmental news. The template contains a hero image, a main column, and a margin with secondary articles.
\\nPlace content in the sidebar with the article
function, and use the cool customized blockquote
s and figure
s!
You can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for dashing-dept-news
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/dashing-dept-news\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the newsletter
function with the following named arguments:
title
: The newsletter\'s title as content.edition
: The edition of the newsletter as content or none
. This is\\ndisplayed at the top of the sidebar.hero-image
: A dictionary with the keys image
and caption
or none
.\\nImage is content with the hero image while caption
is content that is\\ndisplayed to the right of the image.publication-info
: More information about the publication as content or\\nnone
. It is displayed at the end of the document.The function also accepts a single, positional argument for the body of the\\nnewsletter\'s main column and exports the article
function accepting a single content argument to\\npopulate the sidebar.
The template will initialize your package with a sample call to the newsletter
\\nfunction in a show rule. If you, however, want to change an existing project to\\nuse this template, you can add a show rule like this at the top of your file:
#import \\"@preview/dashing-dept-news:0.1.1\\": newsletter, article\\n#show: newsletter.with(\\n title: [Chemistry Department],\\n edition: [\\n March 18th, 2023 \\\\\\n Purview College\\n ],\\n hero-image: (\\n image: image(\\"newsletter-cover.jpg\\"),\\n caption: [Award-wining science],\\n ),\\n publication-info: [\\n The Dean of the Department of Chemistry. \\\\\\n Purview College, 17 Earlmeyer D, Exampleville, TN 59341. \\\\\\n #link(\\"mailto:newsletter@chem.purview.edu\\")\\n ],\\n)\\n\\n// Your content goes here. Use `article` to populate the sidebar and `blockquote` for cool pull quotes.\\n
\\n","description":"A fun newsletter layout for departmental news. The template contains a hero image, a main column, and a margin with secondary articles. Place content in the sidebar with the article function, and use the cool customized blockquotes and figures!\\n\\nUsage\\n\\nYou can use this template in…","guid":"https://typst.app/universe/package/dashing-dept-news","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-06T11:03:09.169Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"wonderous-book (0.1.1) | A fiction book template with running headers and serif typography","url":"https://typst.app/universe/package/wonderous-book","content":"A book template for fiction. The template contains a title page, a table of contents, and a chapter template.
\\nDynamic running headers contain the title of the chapter and the book.
\\nYou can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for wonderous-book
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/wonderous-book\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the book
function with the following named arguments:
title
: The book\'s title as content.author
: Content or an array of content to specify the author.paper-size
: Defaults to iso-b5
. Specify a paper size\\nstring to\\nchange the page format.dedication
: Who or what this book is dedicated to as content or none
. Will\\nappear on its own page.publishing-info
: Details for the front matter of this book as content or\\nnone
.The function also accepts a single, positional argument for the body of the\\nbook.
\\nThe template will initialize your package with a sample call to the book
\\nfunction in a show rule. If you, however, want to change an existing project to\\nuse this template, you can add a show rule like this at the top of your file:
#import \\"@preview/wonderous-book:0.1.1\\": book\\n\\n#show: book.with(\\n title: [Liam\'s Playlist],\\n author: \\"Janet Doe\\",\\n dedication: [for Rachel],\\n publishing-info: [\\n UK Publishing, Inc. \\\\\\n 6 Abbey Road \\\\\\n Vaughnham, 1PX 8A3\\n\\n #link(\\"https://example.co.uk/\\")\\n\\n 971-1-XXXXXX-XX-X\\n ],\\n)\\n\\n// Your content goes below.\\n
\\n","description":"A book template for fiction. The template contains a title page, a table of contents, and a chapter template. Dynamic running headers contain the title of the chapter and the book.\\n\\nUsage\\n\\nYou can use this template in the Typst web app by clicking \\"Start from template\\" on the…","guid":"https://typst.app/universe/package/wonderous-book","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-06T11:03:09.114Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"cereal-words (0.1.0) | Time to kill? Search for words in a box of letters!","url":"https://typst.app/universe/package/cereal-words","content":"Oh no, the Typst guys jumbled the letters! Bring order into this mess by finding the hidden words.
\\nThis small game is playable in the Typst editor and best enjoyed with the web\\napp or typst watch
. It was first released for the 24 Days to Christmas\\ncampaign in winter of 2023.
You can use this template in the Typst web app by clicking \\"Start from template\\"\\non the dashboard and searching for cereal-words
.
Alternatively, you can use the CLI to kick this project off using the command
\\ntypst init @preview/cereal-words\\n
\\nTypst will create a new directory with all the files needed to get you started.
\\nThis template exports the game
function, which accepts a single positional argument for the game input.
The template will initialize your package with a sample call to the game
\\nfunction in a show rule. If you want to change an existing project to use this\\ntemplate, you can add a show rule like this at the top of your file:
#import \\"@preview/cereal-words:0.1.0\\": game\\n#show: game\\n\\n// Type the words here\\n
\\n","description":"Oh no, the Typst guys jumbled the letters! Bring order into this mess by finding the hidden words. This small game is playable in the Typst editor and best enjoyed with the web app or typst watch. It was first released for the 24 Days to Christmas campaign in winter of 2023.\\n\\nUsa…","guid":"https://typst.app/universe/package/cereal-words","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-03-06T11:03:09.030Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"ctheorems (1.1.3) | Numbered theorem environments for typst.","url":"https://typst.app/universe/package/ctheorems","content":"An implementation of numbered theorem environments in\\ntypst. Import using
\\n#import \\"@preview/ctheorems:1.1.3\\": *\\n#show: thmrules\\n
\\nidentifier
s.base
.base_level
.<label>
\'d and @reference
\'d.Get acquainted with ctheorems
by checking out the minimal example below!
You can read the manual for a full walkthrough of functionality offered by this module; flick through manual_examples to just see the examples.
\\n#import \\"@preview/ctheorems:1.1.3\\": *\\n#show: thmrules.with(qed-symbol: $square$)\\n\\n#set page(width: 16cm, height: auto, margin: 1.5cm)\\n#set heading(numbering: \\"1.1.\\")\\n\\n#let theorem = thmbox(\\"theorem\\", \\"Theorem\\", fill: rgb(\\"#eeffee\\"))\\n#let corollary = thmplain(\\n \\"corollary\\",\\n \\"Corollary\\",\\n base: \\"theorem\\",\\n titlefmt: strong\\n)\\n#let definition = thmbox(\\"definition\\", \\"Definition\\", inset: (x: 1.2em, top: 1em))\\n\\n#let example = thmplain(\\"example\\", \\"Example\\").with(numbering: none)\\n#let proof = thmproof(\\"proof\\", \\"Proof\\")\\n
\\n= Prime numbers\\n\\n#definition[\\n A natural number is called a #highlight[_prime number_] if it is greater\\n than 1 and cannot be written as the product of two smaller natural numbers.\\n]\\n#example[\\n The numbers $2$, $3$, and $17$ are prime.\\n @cor_largest_prime shows that this list is not exhaustive!\\n]\\n\\n#theorem(\\"Euclid\\")[\\n There are infinitely many primes.\\n]\\n#proof[\\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\\n contradiction.\\n]\\n\\n#corollary[\\n There is no largest prime number.\\n] <cor_largest_prime>\\n#corollary[\\n There are infinitely many composite numbers.\\n]\\n\\n#theorem[\\n There are arbitrarily long stretches of composite numbers.\\n]\\n#proof[\\n For any $n > 2$, consider $\\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\\n $\\n]\\n
\\nthmproof
function for creating proof environments.#qedhere
in a block equation/list/enum item (in a proof) places\\nthe qed symbol on the same line. The qed symbol can be customized via\\nthmrules
.thmbox
(or thmplain
) are passed to block
.supplement
(for references) is no longer set in thmenv
. It can be passed to the theorem environment directly, along with refnumbering
to control the appearance of @reference
s.thmbox
are passed to block
.fmt
.thmref
, introduced normal <label>
s and @reference
s.show: thmrules
.name: ...
from theorem environments; use #theorem(\\"Euclid\\")[]
instead of #theorem(name: \\"Euclid\\")[]
.figure
s.A Typst library for writing simple tables.
\\n#import \\"@preview/easytable:0.1.0\\": easytable, elem\\n#import elem: *\\n
\\neasytable
function.elem
module.\\nelem.tr
: a data rowelem.th
: a header rowelem.hline
: a horizontal lineelem.vline
: a vertical lineelem.cwidth
: a column-width specifierelem.cstyle
: a column-style (font, alignment, etc.) specifierSee manual in detail.
\\n#easytable({\\n th[Header 1 ][Header 2][Header 3 ]\\n tr[How ][I ][want ]\\n tr[a ][drink, ][alcoholic ]\\n tr[of ][course, ][after ]\\n tr[the ][heavy ][lectures ]\\n tr[involving][quantum ][mechanics.]\\n})\\n
\\n#easytable({\\n cwidth(100pt, 1fr, 20%)\\n cstyle(left, center, right)\\n th[Header 1 ][Header 2][Header 3 ]\\n tr[How ][I ][want ]\\n tr[a ][drink, ][alcoholic ]\\n tr[of ][course, ][after ]\\n tr[the ][heavy ][lectures ]\\n tr[involving][quantum ][mechanics.]\\n})\\n
\\n#easytable({\\n let tr = tr.with(trans: pad.with(x: 3pt))\\n\\n th[Header 1][Header 2][Header 3]\\n tr[How][I][want]\\n tr[a][drink,][alcoholic]\\n tr[of][course,][after]\\n tr[the][heavy][lectures]\\n tr[involving][quantum][mechanics.]\\n})\\n
\\n#easytable({\\n let th = th.with(trans: emph)\\n let tr = tr.with(\\n cell_style: (x: none, y: none)\\n => (fill: if calc.even(y) {\\n luma(95%)\\n } else {\\n none\\n })\\n )\\n\\n th[Header 1][Header 2][Header 3]\\n tr[How][I][want]\\n tr[a][drink,][alcoholic]\\n tr[of][course,][after]\\n tr[the][heavy][lectures]\\n tr[involving][quantum][mechanics.]\\n})\\n
\\n#easytable({\\n th[Header 1][Header 2][Header 3]\\n tr[How][I][want]\\n hline(stroke: red)\\n tr[a][drink,][alcoholic]\\n tr[of][course,][after]\\n tr[the][heavy][lectures]\\n tr[involving][quantum][mechanics.]\\n\\n // Specifying the insertion point directly\\n hline(stroke: 2pt + green, y: 4)\\n vline(\\n stroke: (paint: blue, thickness: 1pt, dash: \\"dashed\\"),\\n x: 2,\\n start: 1,\\n end: 5,\\n )\\n})\\n
\\nAnatomy of a Font. Visualise metrics.
\\nImport the anatomy
package:
#import \\"@preview/anatomy:0.1.1\\": metrics\\n
\\nmetrics(72pt, \\"EB Garamond\\", display: \\"Typewriter\\")
will be rendered as\\nfollows:
Additionally, a closure using metrics
dictionary as parameter can be\\nused to layout additional elements below:
#metrics(54pt, \\"一點明體\\",\\n display: \\"電傳打字機\\",\\n use: metrics => table(\\n columns: 2,\\n ..metrics.pairs().flatten().map(x => [ #x ])\\n )\\n)\\n
\\nIt will generate:
\\nTo typeset CJK text, adopting font\'s ascender/descender as\\ntop-edge
/bottom-edge
makes more sense in some cases. As for most CJK\\nfonts, the difference between ascender and descender heights will be\\nexact 1em.
Tested with metrics(54pt, \\"Hiragino Mincho ProN\\", \\"テレタイプ端末\\")
:
Since Typst will use metrics of the font which has the largest advance\\nheight amongst the list provided in set text(font: ( ... ))
to set up\\ntop and bottom edges of a line, leading might not work as expected in\\nhybrid typesetting. This issue can be solved by passing the document to\\nmetrics(use: metrics => { ... })
like this:
#show: doc => metrics(font.size, font.main,\\n // Retrieve the metrics of the CJK font\\n use: metrics => {\\n set text(\\n font.size,\\n font: ( font.latin, font.main ),\\n features: ( \\"pkna\\", ),\\n // Use CJK font’s ascender/descender as top/bottom edges\\n top-edge: metrics.ascender,\\n bottom-edge: metrics.descender,\\n // ...\\n )\\n\\n doc\\n }\\n)\\n
\\n","description":"Anatomy of a Font. Visualise metrics. Import the anatomy package:\\n\\n#import \\"@preview/anatomy:0.1.1\\": metrics\\n\\nDisplay Metrics\\n\\nmetrics(72pt, \\"EB Garamond\\", display: \\"Typewriter\\") will be rendered as follows:\\n\\nAdditionally, a closure using metrics dictionary as parameter can be…","guid":"https://typst.app/universe/package/anatomy","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-02-19T10:51:59.595Z","media":[{"url":"https://github.com/E8D08F/packages/raw/main/packages/preview/anatomy/0.1.1/img/export-1.svg","type":"photo","width":420,"height":124},{"url":"https://github.com/E8D08F/packages/raw/main/packages/preview/anatomy/0.1.1/img/export-2.svg","type":"photo","width":420,"height":179},{"url":"https://github.com/E8D08F/packages/raw/main/packages/preview/anatomy/0.1.1/img/export-3.svg","type":"photo","width":420,"height":84}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"pubmatter (0.1.0) | Parse, normalize and show publication frontmatter, including authors and affiliations","url":"https://typst.app/universe/package/pubmatter","content":"Beautiful scientific documents with structured metadata for publishers
\\n\\nPubmatter is a typst library for parsing, normalizing and showing scientific publication frontmatter.
\\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 and Quarto, and can load their YAML files directly.
Pubmatter was used to create these documents, for loading the authors in a standardized way and creting the common elements (authors, affiliations, ORCIDs, DOIs, Open Access Links, copyright statements, etc.)
\\nThe full documentation can be found in docs.pdf. To use pubmatter
import it:
#import \\"@preview/pubmatter:0.1.0\\"\\n
\\nThe docs also use pubmatter
, in a simplified way, you can see the docs.typ to see a simple example of using various components to create a new document. Here is a preview of the docs:
The 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:
author: Rowan Cockett\\ndate: 2024/01/26\\n
\\nYou can load that file with yaml
, and pass it to the load
function:
#let fm = pubmatter.load(yaml(\\"pubmatter.yml\\"))\\n
\\nThis will give you a normalized data-structure that can be used with the show
functions for showing various parts of a document.
You can also use a dictionary
directly:
#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
\\nThe theme including color and font choice can be set using the THEME
state.\\nFor example, this document has the following theme set:
#let theme = (color: red.darken(20%), font: \\"Noto Sans\\")\\n#set page(header: pubmatter.show-page-header(theme: theme, fm), footer: pubmatter.show-page-footer(fm))\\n#state(\\"THEME\\").update(theme)\\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.
The 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.
The frontmatter object has the following normalized structure:
\\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
\\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!).
#let fm = pubmatter.load((\\n authors: (\\n (\\n name: \\"Rowan Cockett\\",\\n affiliations: \\"Curvenote Inc.\\",\\n ),\\n (\\n name: \\"Steve Purves\\",\\n affiliations: (\\"Executable Books\\", \\"Curvenote Inc.\\"),\\n ),\\n ),\\n))\\n#raw(lang:\\"yaml\\", yaml.encode(fm))\\n
\\nload()
- Load a raw frontmatter objectdoi-link()
- Create a DOI linkemail-link()
- Create a mailto link with an email icongithub-link()
- Create a link to a GitHub profile with the GitHub iconopen-access-link()
- Create a link to Wikipedia with an OpenAccess iconorcid-link()
- Create a ORCID link with an ORCID logoshow-abstract-block()
- Show abstract-block including all abstracts and keywordsshow-abstracts()
- Show all abstracts (e.g. abstract, plain language summary)show-affiliations()
- Show affiliationsshow-author-block()
- Show author block, including author, icon links (e.g. ORCID, email, etc.) and affiliationsshow-authors()
- Show authorsshow-citation()
- Create a short citation in APA format, e.g. Cockett et al., 2023show-copyright()
- Show copyright statement based on licenseshow-keywords()
- Show keywords as a listshow-license-badge()
- Show the license badgesshow-page-footer()
- Show the venue, date and page numbersshow-page-header()
- Show an open-access badge and the DOI and then the running-title and citationshow-spaced-content()
show-title()
- Show title and subtitleshow-title-block()
- Show title, authors and affiliationsTo help with standardization of metadata or improve the show-functions please contribute to this package:
\\nhttps://github.com/curvenote/pubmatter
\\n\\nNotice: I\'m preparing the update, so the documentation there is referring to the new version.
\\n
conchord
(concise chord) is a Typst package to write lyrics with chords and generate colorful fretboard diagram (aka chord diagram). From 0.1.1
there is also experimental tabs support (though quite simple and unstable yet). It is inspired by chordx package and my previous tiny project for generating chord diagrams SVG-s.
conchord
makes it easy to add new chords, both for diagrams and lyrics. Unlike chordx, you don\'t need to think about layout and pass lots of arrays for drawing barres. Just pass a string with held frets and it will work:
#import \\"@preview/conchord:0.2.0\\": new-chordgen, overchord\\n\\n#let chord = new-chordgen()\\n\\n#box(chord(\\"x32010\\", name: \\"C\\"))\\n#box(chord(\\"x33222\\", name: \\"F#m/C#\\"))\\n#box(chord(\\"x,9,7,8,9,9\\"))\\n
\\n\\n\\n\\n
x
means closed string,0
is open, other number is a fret. In case of frets larger than9
frets should be separated with commas, otherwise you can list them without any separators.
\\n\\nChord diagram works like a usual block, so to put them into one line you need to wrap them into boxes. In real code it is recommended to create a wrapper function to customize box margins etc (see larger example below).
\\n
It is easy to customize the colors and styles of chords with colors
argument and show
rules for text. You can also put !
and *
marks in the end of the string to force diagram generation. !
forces barre, *
removes it:
#let custom-chord = new-chordgen(string-number: 3,\\n colors: (shadow-barre: orange,\\n grid: gray.darken(30%),\\n hold: red,\\n barre: purple)\\n)\\n\\n#set text(fill: purple)\\n#box(custom-chord(\\"320\\", name: \\"C\\"))\\n#box(custom-chord(\\"2,4,4,*\\", name: \\"Bm\\"))\\n#box(custom-chord(\\"2,2,2, *\\"))\\n#box(custom-chord(\\"x,3,2, !\\"))\\n
\\n\\n\\nNOTE: be careful when using !, if barre cannot be used, it will result into nonsense.
\\n
For lyrics, you don\'t need to add chord to word and specify the number of char in words (unlike chordx). Simply add #overchord
to the place you want a chord. Compose with native Typst stylistic things for non-plain look (you don\'t need to dig into chordx\'s custom arguments):
#let och(it) = overchord(strong(it))\\n\\n=== #raw(\\"[Verse 1]\\")\\n\\n#och[Em] Another head \\n#och[C] hangs lowly \\\\\\n#och[G] Child is slowly\\n#och[D] taken\\n\\n...\\n
\\n\\n\\nComplete example of lyrics with chords (see full source):
\\n
I was quite amazed with general idea of chordx, but a bit frustated with implementation, so I decided to quickly rewrite my old js code to Typst. I use cetz
there, so code is quite clean.
\\n\\nNote: This package doesn\'t use any piece of chordx, only the general idea is taken.
\\n
Brief comparison may be seen there, some concepts explained below:
\\nWrite frets for chord as you hold it, like a string like \\"123456\\" (see examples above). You don\'t need to think about layouting and subtracting frets, conchord
does it for you.
\\n\\nNOTE: I can\'t guarantee that will be the best chord layout. Moreover, the logic is quite simple: e.g., barre can\'t be multiple and can\'t be put anywhere except first bar in the image. However, surprisingly, it works well in almost all of the common cases, so the exceptions are really rare.
\\n
If you need to create something too custom/complex ~~(but not concise)~~, maybe it is worth to try chordx. You can also try using core function render-chord
for more manual control, but it is still limited by one barre starting from one (but that barre may be shifted). If you think that feature should be supported, you can create issue there.
Some chord generators put barre only where it ought to be (any less will not hold some strings). Others put it where it can be (sometimes maximal size, sometimes some other logic). I use simple barre where it ought to be, and add shadow barre where it could maximally be. You can easily disable it by either setting use-shadow-barre: false
on new-chordgen
(only necessary part of barre rendered) or by setting color of shadow-barre
the same as barre
(maximal possible barre).
Chord name font size is reduced for large chord names, so the name fits well into chord diagram (see example above). That makes it much more pretty to stack several chords together. To achieve chordx-like behavior, you can always use #figure(chord(\\"…\\"), caption: …)
.
Just add chord labels above lyrics in arbitrary place, don\'t think about what letter exactly it should be located. By default it aligns the chord label to the left, so it produces pretty results out-of-box. You can pass other alignments to alignment
argument, or use the chords straight inside words.
The command is much simpler than chordx (of course, it is a trade-off):
\\n#let overchord(body, align: start, height: 1em, width: -0.25em) = box(place(align, body), height: 1em + height, width: width)\\n
\\nFeel free to use it for your purposes outside of the package.
\\nIt takes on default -0.25em
width to remove one adjacent space, so
width
argument. The problem is that I can\'t measure
space, but maybe that will be eventually fixed.wo #chord[Am]rd
.Customize the colors of chord elements. new-chordgen
accepts the colors
dictionary with following possible fields:
grid
: color of grid, default is gray.darken(20%)
open
: color of circles for open strings, default is black
muted
: color of crosses for muted strings, default is black
hold
: color of held positions, default is #5d6eaf
barre
: color of main barre part, default is #5d6eaf
shadow-barre
: color of \\"unnecessary\\" barre part, default is #5d6eaf.lighten(30%)
Important: frets are rendered using raw
elements. So if you want to customize their font or color, please use #show raw: set text(fill: ...)
or similar things.
The chord\'s name, on the other hand, uses default font, so to set it, just use #set text(font: ...)
in the corresponding scope.
Currently chordx has almost no checks inside for correctness of passed chords. conchord
, on the other side, checks for
x
passed as frets\\n\\nEverything there is highly experimental and unstable
\\n
#let chord = new-chordgen(scale-length: 0.6pt)\\n\\n#let ending(n) = {\\n rect(stroke: (left: black, top: black), inset: 0.2em, n + h(3em))\\n v(0.5em)\\n}\\n*This thing doesn\'t follow musical notation rules, it is used just for demonstration purposes*:\\n\\n#tabs.new(```\\n2/4 2/4-3 2/4-2 2/4-3 |\\n2/4-2 2/4-3 2/4 2/4 2/4 |\\n2/4-2 p 0/2-3 3/2-2\\n|:\\n\\n0/1+0/6 0/1 0/1-3 2/1 | 3/1+3/5-2 3/1 3/1-3 5/1 | 2/1+0/4-2 2/1 0/1-3 3/2-3 | \\\\ \\\\\\n3/2-2 `5/2-3\\np-2\\n##\\n chord(\\"022000\\", name: \\"Em\\")\\n##south\\n0/2-3 3/2 | | ## [...] ## p-4. | | 7/1-3 0/1-2 p-3 0/1 3/1 \\n\\n##\\n ending[1.]\\n##west\\n\\n|\\n2/1-3\\n2/1\\n3/1 0/1 2/1-2 p-3 0/2-3 3/2-3\\n##\\n ending[2.]\\n##west\\n|\\n2/1-2 2/1 0/1-3 3/2 :| 0/6-2 | ^0/6-2 || \\\\\\n1/1 2/1 2/2 2/2 2/3 2/3 4/4 4/4 4/4 4/4 4/4 4/4 2/3 2/3 2/3 2/3 2/3 2/3 2/3 2/3 2/3 2/3 2/3 2/3 2/3\\n##\\n[notice there is no manual break]\\n##east\\n| 2/3 2/3 8/3 7/3 6/3 5/3 4/3 2/3 5/3 8/3 9/3 7/3 2/3 | 2/3 2/2 2/3 2/4 |\\n10/1-3 10/1-3 10/1-3 10/1-4 10/1-4 10/1-4 10/1-4 10/1-5. 10/1-5. 10/1-5 10/1-5 10/1-2 \\\\\\n1/3bfullr+2/5-2 1/2b1/2-1 2/3v-1\\n```, eval-scope: (chord: chord, ending: ending)\\n )\\n\\n\\nNot a lot customization is available yet, but something is already possible:\\n\\n#show raw: set text(red.darken(30%), font: \\"Comic Sans MS\\")\\n\\n#tabs.new(\\"0/1+2/5-1 ^0/1+`3/5-2.. 2/3 |: 2/3-1 2/3 2/3 | 3/3 ||\\",\\n scale-length: 0.2cm,\\n one-beat-length: 12,\\n s-num: 5,\\n colors: (\\n lines: gradient.linear(yellow, blue),\\n bars: green,\\n connects: red\\n ),\\n enable-scale: false\\n)\\n
\\nAs you can see from example, you can use raw strings or code blocks to write tabs, there is no real difference.
\\nThe general idea is very simple: to write a number on some line, write <fret number>/<string>
.
Spaces are important! All notes and special symbols work well only if properly separated.
\\nBy default they will be quarter notes. To change that, you have to specify the duration: <fret>/<string>-<duration>
, where duration is $log_2$ from note duration. So a whole note will be -0
, a half: -1
and so on. You can also use as many dots as you want to multiply duration by 1.5, e.g. -2.
Once you change the duration, all the following notes will use it, so you have to specify duration every time it is changed (basically, always, but it really depends on composition). Of course, you can just ignore all that duration staff.
\\nTo add simple bar, just add |
. To add double bar line, use | |
. To add end movement/composition, add ||
. To add repetitions, use |:
and :|
respectively.
Notes and bars that don\'t fit in line will be automatically moved to next. However, sometimes it isn\'t ideal and may be a bit bugged, so it is recommended to do that manually, using \\\\
.
The line is autoscaled if it is possible and not too ugly. You can change the maximum and minimum scaling size with scale-max
and scale-min
. It is also possible to completely disable scaling with enable-scale: false
.
You can tie notes or slide between them. To use ties, you have to add ^
in front of second tied note, like 1/1 ^3/1
. To use slides you have to do the same, but with `.
Current limitation: tying and sliding works only on the same string and may work really bad if tied/slided through line break.
\\nAdd b
after note, but before the duration (e.g. 2/3b-2
) to add a bend. After b
you can write custom text to be written on top (for example, b1/2
). Add r
to the end to add a release.
Adding vibratos works the same way, via adding v
to the note. The length of vibrato will be the same as the length of the note.
Unfortunately, they are all supported things for now. But wait, there is still one cool thing left!
\\nAdd any typst code you want between ## … ##
. It will be rendered with cetz
on top of the line where you wrote it. That means you can write lyrics, chords, add complex things like endings, even draw the elements that are still missing (well, it is still worth to create issue there, I will try to do something).
That code is evaluated with eval
, so you will need to pass dictionary to eval-scope
with all things you want to use.
You can set align of these elements by writing cetz anchors after the second (e.g., west
, south
and their combinations, like west-south
).
Additionally, if you enjoy drawing missing things, you can also use preamble
and extra
arguments in tabs.new
where you can put any cetz
inner things (tabs uses canvas, and that allow you drawing on it) before or after the tabs are drawn.
It is far from what I want to do, so maybe there will be much more! I will be very glad to receive any feedback, both issues and PR-s are very welcome (though I can\'t promise I will be able to work on it immediately)!
\\n","description":"Notice: I\'m preparing the update, so the documentation there is referring to the new version. conchord (concise chord) is a Typst package to write lyrics with chords and generate colorful fretboard diagram (aka chord diagram). From 0.1.1 there is also experimental tabs support…","guid":"https://typst.app/universe/package/conchord","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-02-06T22:37:47.038Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/conchord/0.2.0/examples/simple.png","type":"photo","width":487,"height":194},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/conchord/0.2.0/examples/crazy.png","type":"photo","width":524,"height":194},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/conchord/0.2.0/examples/zombie.png","type":"photo","width":1191,"height":1263},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/conchord/0.2.0/examples/compare.png","type":"photo","width":2373,"height":1747},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/conchord/0.2.0/examples/tabs.png","type":"photo","width":1320,"height":984}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"jogs (0.2.3) | QuickJS JavaScript runtime for Typst","url":"https://typst.app/universe/package/jogs","content":"Quickjs javascript runtime for typst. This package provides a typst plugin for evaluating javascript code.
\\n#import \\"@preview/jogs:0.2.3\\": *\\n\\n#set page(height: auto, width: auto, fill: black, margin: 1em)\\n#set text(fill: white)\\n\\n#let code = ```\\nfunction sum() {\\n const total = Array.prototype.slice.call(arguments).reduce(function(a, b) {\\n return a + b;\\n }, 0);\\n return total;\\n}\\n\\nfunction string_join(arr) {\\n return arr.join(\\" | \\");\\n}\\n\\nfunction return_complex_obj() {\\n return {\\n a: 1,\\n b: \\"2\\",\\n c: [1, 2, 3],\\n d: {\\n e: 1,\\n },\\n };\\n}\\n\\n```\\n#let bytecode = compile-js(code)\\n\\n#list-global-property(bytecode)\\n\\n#call-js-function(bytecode, \\"sum\\", 6, 7, 8, 9, 10)\\n\\n#call-js-function(bytecode, \\"string_join\\", (\\"a\\", \\"b\\", \\"c\\", \\"d\\", \\"e\\"),)\\n\\n#call-js-function(bytecode, \\"return_complex_obj\\",)\\n\\n\\n
\\nresult:
\\nThis package provide following function(s):
\\neval-js
Run a Javascript code snippet.
\\ncode
- The Javascript code to run. It can be a string or a raw block.The result of the Javascript code. The type is the typst type which most closely resembles the Javascript type.
\\n#let result = eval-js(\\"1 + 1\\")\\n
\\ncompile-js
Compile a Javascript code snippet into bytecode.
\\ncode
- The Javascript code to compile. It can be a string or a raw block.The bytecode of the Javascript code. The type is bytes
.
#let bytecode = compile-js(\\"function sum(a, b) { return a + b; }\\")\\n
\\ncall-js-function
Call a Javascript function with arguments.
\\nbytecode
- The bytecode of the Javascript function. It can be obtained by calling compile-js
.name
- The name of the Javascript function...args
- The arguments to pass to the Javascript function. All other positional arguments are passed to the Javascript function as is.The result of the Javascript function. The type is the typst type which most closely resembles the Javascript type.
\\n#let bytecode = compile-js(\\"function sum(a, b) { return a + b; }\\")\\n#let result = call-js-function(bytecode, \\"sum\\", 1, 2)\\n
\\nlist-global-property
List all global properties of a compiled Javascript bytecode. This is useful for inspecting the compiled Javascript bytecode.
\\nbytecode
- The bytecode of the Javascript function. It can be obtained by calling compile-js
.A list of all global properties of the Javascript bytecode. The type is array
.
#let bytecode = compile-js(\\"function sum(a, b) { return a + b; }\\")\\n#let result = list-global-property(bytecode)\\n
\\n","description":"Quickjs javascript runtime for typst. This package provides a typst plugin for evaluating javascript code. Example\\n#import \\"@preview/jogs:0.2.3\\": *\\n\\n#set page(height: auto, width: auto, fill: black, margin: 1em)\\n#set text(fill: white)\\n\\n#let code = ```\\nfunction sum() {\\n const…","guid":"https://typst.app/universe/package/jogs","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-02-01T13:13:11.067Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/jogs/0.2.3/typst-package/examples/fib.svg","type":"photo"}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"chromo (0.1.0) | Generate printer tests (likely CMYK) in typst.","url":"https://typst.app/universe/package/chromo","content":"Generate printer tests directly in Typst.\\nFor now, only generates with CMYK colors (as it is by far the most used).
\\nI personally place one of these test on all my exam papers to ensure the printer\'s quality over time.
\\nTo import any of the functions needed, you may want to use the following line:
\\n#import \\"@preview/chromo:0.1.0\\": square-printer-test, gradient-printer-test, circular-printer-test, crosshair-printer-test\\n
\\n#square-printer-test()\\n
\\n#gradient-printer-test()\\n
\\n#circular-printer-test()\\n
\\n#crosshair-printer-test()\\n
\\nA Typst package enabling support for Unicode super- and subscript characters in equations.
\\nThe package exposes the template-function super-subscripts
. It affects all math.equation
s by attaching every superscript- and subscript-character to the first non-space-element on its left.
#import \\"@preview/super-suboptimal:0.1.0\\": *\\n#show: super-subscripts\\n\\nFor all $(x,y)∈ℝ²$:\\n$\\n q := norm((x,y))₂ < 1\\n ==> ∑ᵢ₌₁ⁿ q ⁱ < ∞\\n$\\n
\\nBecause code like $x+yᶻ$
throws an \\"unknown variable\\" error, the package also exposes the function eq
, which inserts spaces before every superscript- and subscript-character and passing it on to math.equation
. This comes at the cost of missing syntax-highlighting and code-suggestions in your IDE.
eq
accepts a raw
string as a positional parameter, and an argument-sink that\'s passed onto math.equation
. Unless specified otherwise in the argument-sink, the resulting equation is typeset with block: true
if and only if the raw
also satisfied block: true
. eq
is automatically applied to every raw
with lang: \\"eq\\"
.
#eq(`0 = aᵇ`)\\n\\n#eq(```\\n 1 = x+yᶻ\\n```)\\n\\n#eq(`2 = aᵇ`, block: true, numbering: \\"(1)\\")\\n\\n```eq\\n 3 = aᵇᶜ⁺ᵈ₃ₑ⁽ᶠ⁻ᵍ⁾ₕᵢ\\n```\\n
\\nSometimes in mathematical writing, variables are decorated with an asterisk, e.g. $x^*$
. The character ꙳
can now be used, as well: $x꙳ = x^*$
.
As mentioned above, $aᵇ$
leads to an \\"unknown variable\\" error. As a workaround, $a ᵇ$
produces the same output, or you can use the eq
function described above.
$a ³b$
is rendered like $attach(a, t: 3) b$
, rather than $a attach(b, tl: 3)$
.Multiple attachments are concatenated into one content without another pass of equation
. For example, #eq(`0ˢⁱⁿ⁽ᵏ⁾`)
is equivalent to $0^(s i n \\"(\\" k \\")\\")$
, rather than $0^sin(k)$
. I won\'t fix this, because:
equation
would cause performance issues at best, and infinite loops at worst.$e ˣ ʸ$
would undesirably produce an \\"unknown variable xy
\\" error.Let\'s call a piece of content \\"small\\" if it consists of only a single non-separated sequence of characters in Typst (internally, this is the distinction between the content-functions sequence
and text
). For instance, $1234$
and $a$
constitute \\"small\\" content, but $a b$
and $3a$
and $1+2+3+4+5$
do not.
This package only runs on non-\\"small\\" pieces of content. For example, $sqrt(35²)$
still renders with the default-Unicode-character and will look different from $sqrt(35^2)$
. On the other hand, $sqrt(a⁶)$
is rendered correctly. This is because 35²
constitutes \\"small\\" content, but a⁶
does not.
A workaround is implemented for \\"small\\" content immediately within an equation, i.e. not nested within another content-function. For example, $7²$
renders the same as $7^2$
, even though it\'s \\"small\\" content.
Equations within other content-elements might trigger multiple show-rule-passes, possibly causing performance-issues.
\\nUntil https://github.com/typst/typst/issues/553 is resolved,\\ntypst
doesn’t natively support wrapping text around figures or other\\ncontent. However, you can use wrap-it
to mimic much of this\\nfunctionality:
Wrapping images left or right of their text
\\nSpecifying margins
\\nAnd more
\\nDetailed descriptions of each parameter are available in the wrap-it\\ndocumentation.
\\nThe easiest method is to import wrap-it: wrap-content
from the\\n@preview
package:
#import \\"@preview/wrap-it:0.1.0\\": wrap-content\\n
\\n#set par(justify: true)\\n#let fig = figure(\\n rect(fill: teal, radius: 0.5em, width: 8em),\\n caption: [A figure],\\n)\\n#let body = lorem(40)\\n#wrap-content(fig, body)\\n
\\n#wrap-content(\\n fig,\\n body,\\n align: bottom + right,\\n column-gutter: 2em\\n)\\n
\\nThe easiest way to get a uniform, highly-customizable margin is through\\nboxing your image:
\\n#let boxed = box(fig, inset: 0.5em)\\n#wrap-content(boxed)[\\n #lorem(40)\\n]\\n
\\n#let fig2 = figure(\\n rect(fill: lime, radius: 0.5em),\\n caption: [Another figure],\\n)\\n#wrap-top-bottom(boxed, fig2, lorem(60))\\n
\\nSVG icons for open-science articles
\\n#import \\"@preview/scienceicons:0.0.6\\": open-access-icon\\n\\nThis article is Open Access #open-access-icon(color: orange, height: 1.1em, baseline: 20%)\\n
\\nThe arguments for each icon are:
\\ncolor
: A typst color, red
, red.darken(20%)
, color(#FF0000)
, etc. Default is black
.height
: The height of the icon, by default this is slightly larger than the text height at 1.1em
baseline
: Change the baseline of the box surrounding the icon, moving the icon up and down. Default is 13.5%
.Additionally the raw SVG text for each icon can be found by replacing Icon
with Svg
.
You can browse and see all icons here:
\\nhttps://github.com/curvenote/scienceicons/tree/main/typst/docs/scienceicons.pdf
\\nTo add or request an icon to be added to this package see:
\\nhttps://github.com/curvenote/scienceicons
Configurable figure numbering per section.
\\nHave a look at the source here.
\\nHave a look at the source here.
\\nThe package mainly consists of two customizable show rules, which set up all the\\nnumbering. There is also an additional function to make showing an outline of\\nfigures easier.
\\nBecause the show-figure()
function must internally create\\nanother figure element, attached labels cannot directly be used for references.\\nTo circumvent this, a new label is attached to the internal figure, with the\\nsame name but prefixed with fig:
, tbl:
, or lst:
for images (and all other\\ntypes of generic figures), tables, and raw code figures (aka listings)\\nrespectively. These new labels can be used for referencing without problems.
// import the package\\n#import \\"@preview/i-figured:0.2.4\\"\\n\\n// make sure you have some heading numbering set\\n#set heading(numbering: \\"1.\\")\\n\\n// apply the show rules (these can be customized)\\n#show heading: i-figured.reset-counters\\n#show figure: i-figured.show-figure\\n\\n// show an outline\\n#i-figured.outline()\\n\\n= Hello World\\n\\n#figure([hi], caption: [Bye World.]) <bye>\\n\\n// when referencing, the label names must be prefixed with `fig:`, `tbl:`,\\n// or `lst:` depending on the figure kind.\\n@fig:bye displays the text \\"hi\\".\\n
\\nreset-counters
Reset all figure counters. To be used in a heading show rule like\\n#show heading: i-figured.reset-counters
.
#let reset-counters(\\n it,\\n level: 1,\\n extra-kinds: (),\\n equations: true,\\n return-orig-heading: true,\\n) = { .. }\\n
\\nArguments:
\\nit
: content
— The heading element from the show rule.level
: int
— At which heading level to reset the counters. A value\\nof 2
will cause the counters to be reset at level two and level one\\nheadings.extra-kinds
: array
of (str
or function
) — Additional\\ncustom figure kinds. If you have any figures with a kind
other than image
,\\ntable
, or raw
, you must add the kind
here for its counter to be reset.equations
: bool
— Whether the counter for math equations should be\\nreset.return-orig-heading
: bool
— Whether the original heading element\\nshould be included in the returned content. Set this to false if you manually\\nwant to construct a heading instead of using the default.Returns: content
— The unmodified heading.
show-figure
Show a figure with per-section numbering. To be used in a figure show rule like\\n#show figure: i-figured.show-figure
.
#let show-figure(\\n it,\\n level: 1,\\n zero-fill: true,\\n leading-zero: true,\\n numbering: \\"1.1\\",\\n extra-prefixes: (:),\\n fallback-prefix: \\"fig:\\",\\n) = { .. }\\n
\\nArguments:
\\nit
: content
— The figure element from the show rule.level
: int
— How many levels of the current heading counter should\\nbe added in front. Note that you can control this individually from the\\nlevel
parameter on reset-counters()
.zero-fill
: bool
— If true
and assuming a level
of 2
, a\\nfigure after a 1.
heading but before a 1.1.
heading will show 1.0.1
as\\nnumbering, else the middle zero is excluded. Note that if set to false
, not\\nall figure numberings are guaranteed to have the same length.leading-zero
: bool
— Whether figures before the first top-level\\nheading should have a leading 0
. Note that if set to false
, not all figure\\nnumberings are guaranteed to have the same length.numbering
: str
or function
— The actual numbering pattern to\\nuse for the figures.extra-prefixes
: dictionary
of str
to str
pairs —\\nAdditional label prefixes. This can optionally be used to specify prefixes for\\ncustom figure kinds, otherwise they will also use the fallback prefix.fallback-prefix
: str
— The label prefix to use for figure kinds\\nwhich don\'t have another prefix set.Returns: content
— The modified figure.
show-equation
Show a math equation with per-section numbering. To be used in a show rule like\\n#show math.equation: i-figured.show-equation
.
#let show-equation(\\n it,\\n level: 1,\\n zero-fill: true,\\n leading-zero: true,\\n numbering: \\"(1.1)\\",\\n prefix: \\"eqt:\\",\\n only-labeled: false,\\n unnumbered-label: \\"-\\",\\n) = { .. }\\n
\\nArguments:
\\nFor the arguments level
, zero-fill
, leading-zero
, and numbering
refer to\\nshow-figure()
.
it
: content
— The equation element from the show rule.prefix
: str
— The label prefix to use for all equations.only-labeled
: bool
— Whether only equations with labels should be\\nnumbered.unnumbered-label
: str
— A label to explicitly disable numbering\\nfor an equation.Returns: content
— The modified equation.
outline
Show the outline for a kind of figure. This is just the same as calling\\noutline(target: figure.where(kind: i-figured._prefix + repr(target-kind)), ..)
,\\nthe function just exists for convenience and clarity.
#let outline(target-kind: image, title: [List of Figures], ..args) = { .. }\\n
\\nArguments:
\\ntarget-kind
: str
or function
— Which kind of figure to list.title
: content
or none
— The title of the outline...args
— Other arguments to pass to the underlying\\noutline()
call.Returns: content
— The outline element.
The core code is based off code from @PgBiel\\n(@PgSuper
on Discord) and @aagolovanov\\n(@aag.
on Discord). Specifically from\\nthis message\\nand the conversation around\\nhere.
日本語のダミーテキスト(Lipsum)生成ツール。
\\nBlind text (Lorem ipsum) generator for Japanese.
\\n#import \\"@preview/roremu:0.1.0\\": roremu\\n\\n#roremu(8) # 吾輩は猫である。\\n\\n#roremu(8, offset: 8) #名前はまだ無い。\\n\\n#roremu(17, custom-text: \\"私はその人を常に先生と呼んでいた。\\")\\n
\\nlorem「ロレム」のローマ字表記。
\\n“roremu” is the romanization of ロレム (lorem).
\\nUnlicense
\\n","description":"日本語のダミーテキスト(Lipsum)生成ツール。 Blind text (Lorem ipsum) generator for Japanese.\\n\\n用法 / Usage\\n#import \\"@preview/roremu:0.1.0\\": roremu\\n\\n#roremu(8) # 吾輩は猫である。\\n\\n#roremu(8, offset: 8) #名前はまだ無い。\\n\\n#roremu(17, custom-text: \\"私はその人を常に先生と呼んでいた。\\")\\n\\nテキスト / Text Source\\n\\n夏目漱石『吾輩は猫である』(青空文庫版より抜粋、ルビ抜き)…","guid":"https://typst.app/universe/package/roremu","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-01-23T13:14:16.046Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"m-jaxon (0.1.1) | Render LaTeX equation in typst using MathJax.","url":"https://typst.app/universe/package/m-jaxon","content":"Render LaTeX equation in typst using MathJax.
\\nNote: This package is made for fun and to demonstrate the capability of typst plugins.\\nAnd it is slow. To actually convert LaTeX equations to typst ones, you should use pandoc or texmath.
\\n#import \\"./typst-package/lib.typ\\" as m-jaxon\\n// Uncomment the following line to use the m-jaxon from the official package registry\\n// #import \\"@preview/m-jaxon:0.1.1\\"\\n\\n= M-Jaxon\\n\\nTypst, now with *MathJax*.\\n\\nThe equation of mass-energy equivalence is often written as $E=m c^2$ in modern physics.\\n\\nBut we can also write it using M-Jaxon as: #m-jaxon.render(\\"E = mc^2\\", inline: true)\\n\\n
\\nrender
Render a LaTeX equation string to an svg image. Depending on the inline
argument, the image will be rendered as an inline image or a block image.
src
: str
or raw
block - The LaTeX equation stringinline
: bool
- Whether to render the image as an inline image or a block imageThe image, of type content
syntree is a typst package for rendering syntax trees / parse trees (the kind linguists use).
\\nThe name and syntax are inspired by Miles Shang\'s syntree. Here\'s an example to get started:
\\n\\n \\n | \\n\\n | \\n
There\'s limited support for formulas inside nodes; try #syntree(\\"[DP$zws_i$ this]\\")
or #syntree(\\"[C $diameter$]\\")
.
For more flexible tree-drawing, use tree
:
\\n \\n | \\n\\n | \\n
More powerful and customizable tables in Typst.
\\nIf you\'d like to appear here, consider sponsoring the project!
\\n\\n\\n\\n\\n\\nSummary: Please use built-in Typst tables instead of tablex. Most of tablex\'s features were implemented in Typst 0.11.0, see the docs.
\\nHowever, keep an eye for future tablex updates as there might be some interesting goodies ahead, including CeTZ support!
\\nDetails:
\\nA large amount of tablex\'s features have successfully been upstreamed by this package\'s author to Typst\'s built-in table
and grid
elements (see the new Tables Guide, at https://typst.app/docs/guides/table-guide/, and the table
element\'s reference, at https://typst.app/docs/reference/model/table/, for more information).
This effort was tracked in the following Typst issue: https://github.com/typst/typst/issues/3001
\\nThis means that, starting with Typst 0.11.0, many advanced table features can now be used with Typst grids and tables without tablex! This includes:
\\ntable.cell(inset: ..., align: ..., fill: ...)[body]
, and #show table.cell: it => ...
instead of map-cells
);table.cell(colspan: 2, rowspan: 2)[body]
);stroke
parameter of table.cell
to control the lines around it, and you can use table.hline
and table.vline
which work similarly to their tablex counterparts - the equivalent of map-hlines
and map-vlines
is table(stroke: (x, y) => (left: ..., right: ..., top: ..., bottom: ...))
);table.header(... cells ...)
);grid
as well by replacing table
with grid
where applicable (e.g. grid.cell
instead of table.cell
).Additionally, built-in Typst tables have support for features which weren\'t previously available within tablex, such as repeatable table footers (through table.footer
and grid.footer
).
Therefore, for the vast majority of use cases, you will no longer need to use this library.
\\nThere are a few observations:
\\nfit-spans
option, through which colspans and rowspans don\'t cause auto
-sized columns and/or rows to expand, is not yet supported in built-in tables.If there any questions, feel free to open a thread in the Discussions
page of this repository, or ping the author on Discord. Thanks to everyone who supported me throughout tablex\'s development and the upstreaming process. I hope you enjoy the new update, and have fun with tables! 😄
And make sure to keep an eye for future tablex updates. 😉
\\nNOTE: Please use built-in tables instead of this library (see notice above). The rest of the README is kept for reference purposes only.
\\nTo use this library through the Typst package manager (for Typst v0.6.0+), write for example #import \\"@preview/tablex:0.0.9\\": tablex, cellx
at the top of your Typst file (you may also add whichever other functions you use from the library to that import list!).
For older Typst versions, download the file tablex.typ
from the latest release (or directly from the main branch, for the \'bleeding edge\') at the tablex repository (https://github.com/PgBiel/typst-tablex) and place it on the same folder as your own Typst file. Then, at the top of your file, write for example #import \\"tablex.typ\\": tablex, cellx
(plus whichever other functions you use from the library).
This library should be compatible with Typst versions between v0.2.0 and v0.12.0 (inclusive).\\nUsing the latest Typst version is always recommended in order to make use of the latest optimizations and features available.
\\nHere\'s an example of what tablex
can do:
Here\'s the code for that table:
\\n#import \\"@preview/tablex:0.0.9\\": tablex, rowspanx, colspanx\\n\\n#tablex(\\n columns: 4,\\n align: center + horizon,\\n auto-vlines: false,\\n\\n // indicate the first two rows are the header\\n // (in case we need to eventually\\n // enable repeating the header across pages)\\n header-rows: 2,\\n\\n // color the last column\'s cells\\n // based on the written number\\n map-cells: cell => {\\n if cell.x == 3 and cell.y > 1 {\\n cell.content = {\\n let value = int(cell.content.text)\\n let text-color = if value < 10 {\\n red.lighten(30%)\\n } else if value < 15 {\\n yellow.darken(13%)\\n } else {\\n green\\n }\\n set text(text-color)\\n strong(cell.content)\\n }\\n }\\n cell\\n },\\n\\n /* --- header --- */\\n rowspanx(2)[*Username*], colspanx(2)[*Data*], (), rowspanx(2)[*Score*],\\n (), [*Location*], [*Height*], (),\\n /* -------------- */\\n\\n [John], [Second St.], [180 cm], [5],\\n [Wally], [Third Av.], [160 cm], [10],\\n [Jason], [Some St.], [150 cm], [15],\\n [Robert], [123 Av.], [190 cm], [20],\\n [Other], [Unknown St.], [170 cm], [25],\\n)\\n
\\n#table
(Update: tablex\'s syntax was designed to be compatible with Typst tables created up to Typst v0.10.0. The new table features introduced in Typst v0.11.0 use syntax which isn\'t compatible with tablex, so it won\'t be a drop-in replacement in that case. However, tablex does have its own syntax for those features, as will be explained below!)
\\nIn most cases, you should be able to replace #table
with #tablex
and be good to go for a start - it should look very similar (if not identical). Indeed, the syntax is very similar for the basics:
#import \\"@preview/tablex:0.0.9\\": tablex\\n\\n#tablex(\\n columns: (auto, 1em, 1fr, 1fr), // 4 columns\\n rows: auto, // at least 1 row of auto size\\n fill: red,\\n align: center + horizon,\\n stroke: green,\\n [a], [b], [c], [d],\\n [e], [f], [g], [h],\\n [i], [j], [k], [l]\\n)\\n
\\nThere are still a few oddities in the library (see Known Issues for more info), but, for the vast majority of cases, replacing #tablex
by #table
should work just fine. (Sometimes you can even replace #grid
by #gridx
- see the line customization section for more -, but not always, as the behavior is a bit different.)
This is mostly a word of caution in case anything I haven\'t anticipated happens, but, based on my tests (and after tons of bug-fixing commits), the vast majority of tables (that don\'t face one of the listed known issues) should work just fine under the library.
\\nNote: If your document is written in a right-to-left (RTL) script, you may wish to enable rtl: true
for your tables so that the order of cells and lines properly follows your text direction (when combined with set text(dir: rtl)
). This is necessary because tablex cannot detect that setting automatically at the moment (while the native Typst table can and flips itself horizontally automatically). See the tablex option reference for more information.
Your cells can now span more than one column and/or row at once, with colspanx
/ rowspanx
:
#import \\"@preview/tablex:0.0.9\\": tablex, colspanx, rowspanx\\n\\n#tablex(\\n columns: 3,\\n colspanx(2)[a], (), [b],\\n [c], rowspanx(2)[d], [ed],\\n [f], (), [g]\\n)\\n
\\nNote that the empty parentheses there are just for organization, and are ignored (unless they come before the first cell - more on that later). They\'re useful to help us keep track of which cell positions are being used up by the spans, because, if we try to add an actual cell at these spots, it will just push the others forward, which might seem unexpected.
\\nUse colspanx(2, rowspanx(2)[d])
to colspan and rowspan at the same time. Be careful not to attempt to overwrite other cells\' spans, as you will get a nasty error.
Note (since tablex v0.0.8): By default, colspans and rowspans can cause spanned auto
columns and rows to expand to fit their contents (only the last spanned track - column or row - can expand). If you\'d like colspans to not affect column sizes at all (and thus \\"fit\\" within their spanned columns), you may specify fit-spans: (x: true)
to the table. Similarly, you can specify fit-spans: (y: true)
to have rowspans not affect row sizes at all. To apply both effects, use either fit-spans: true
or fit-spans: (x: true, y: true)
. You can also apply this to a single colspan (for example) with colspanx(2, fit-spans: (x: true))[a]
, as this option is available not only for the whole table but also for each cell. See the reference section for more information.
You can now ensure the first row (or, rather, the rows covered by the first rowspan) in your table repeats across pages. Just use repeat-header: true
(default is false
).
Note that you may wish to customize this. Use repeat-header: 6
to repeat for 6 more pages. Use repeat-header: (2, 4)
to repeat only on the 2nd and the 4th page (where the 1st page is the one the table starts in). Additionally, use header-rows: 5
to ensure the first (e.g.) 5 rows are part of the header (by default, this is 1 - more rows will be repeated where necessary if rowspans are used).
Also, note that, by default, the horizontal lines below the header are transported to other pages, which may be an annoyance if you customize lines too much (see below). Use header-hlines-have-priority: false
to ensure that the first row in each page will dictate the appearance of the horizontal lines above it (and not the header).
Note: Depending on the size of your document, repeatable headers might not behave properly due to certain limitations in Typst\'s introspection system (as observed in https://github.com/PgBiel/typst-tablex/issues/43).
\\nExample:
\\n#import \\"@preview/tablex:0.0.9\\": tablex, hlinex, vlinex, colspanx, rowspanx\\n\\n#pagebreak()\\n#v(80%)\\n\\n#tablex(\\n columns: 4,\\n align: center + horizon,\\n auto-vlines: false,\\n repeat-header: true,\\n\\n /* --- header --- */\\n rowspanx(2)[*Names*], colspanx(2)[*Properties*], (), rowspanx(2)[*Creators*],\\n (), [*Type*], [*Size*], (),\\n /* -------------- */\\n\\n [Machine], [Steel], [5 $\\"cm\\"^3$], [John p& Kate],\\n [Frog], [Animal], [6 $\\"cm\\"^3$], [Robert],\\n [Frog], [Animal], [6 $\\"cm\\"^3$], [Robert],\\n [Frog], [Animal], [6 $\\"cm\\"^3$], [Robert],\\n [Frog], [Animal], [6 $\\"cm\\"^3$], [Robert],\\n [Frog], [Animal], [6 $\\"cm\\"^3$], [Robert],\\n [Frog], [Animal], [6 $\\"cm\\"^3$], [Robert],\\n [Frog], [Animal], [6 $\\"cm\\"^3$], [Rodbert],\\n)\\n
\\nEvery single line in the table is either a hlinex
(horizontal) or vlinex
(vertical) instance. By default, there is one between every column and between every row - unless you specify a custom line for some column or row, in which case the automatic line for it will be removed (to allow you to freely customize it). To disable this behavior, use auto-lines: false
, which will remove all automatic lines. You may also remove only automatic horizontal lines with auto-hlines: false
, and only vertical with auto-vlines: false
.
Note: gridx
is an alias for tablex
with auto-lines: false
.
For your custom lines, write hlinex()
at any position and it will add a horizontal line below the current cell row (or at the top, if before any cell). You can use hlinex(start: a, end: b)
to control the cells which that line spans (a
is the first column number and b
is the last column number). You can also specify its stroke (color/thickness) with hlinex(stroke: red + 5pt)
for example. To position it at an arbitrary row, use hlinex(y: 6)
or similar. (Columns and rows are indexed starting from 0.)
Something similar occurs for vlinex()
, which has start
, end
(first row and last row it spans), and also stroke
. They will, by default, be placed to the right of the current cell, and will span the entire table (top to bottom). To override the default placement, use vlinex(x: 2)
or similar.
Note: Only one hline or vline with the same span (same start/end) can be placed at once.
\\nNote: You can also place vlines before the first cell, in which case they will be placed consecutively, each after the last vlinex()
. That is, if you place several of them in a row (before the first cell only), then it will not place all of them at one location (which is normally what happens if you try to place multiple vlines at once), but rather one after the other. With this behavior, you can also specify ()
between each vline to skip certain positions (again, only before the first cell - afterwards, all ()
are ignored). Note that you can also just ignore this entirely and use vlinex(x: 0)
, vlinex(x: 1)
, ..., vlinex(x: columns.len())
for full control.
Here\'s some sample usage:
\\n#import \\"@preview/tablex:0.0.9\\": tablex, gridx, hlinex, vlinex, colspanx, rowspanx\\n\\n#tablex(\\n columns: 4,\\n auto-lines: false,\\n\\n // skip a column here vv\\n vlinex(), vlinex(), vlinex(), (), vlinex(),\\n colspanx(2)[a], (), [b], [J],\\n [c], rowspanx(2)[d], [e], [K],\\n [f], (), [g], [L],\\n // ^^ \'()\' after the first cell are 100% ignored\\n)\\n\\n#tablex(\\n columns: 4,\\n auto-vlines: false,\\n colspanx(2)[a], (), [b], [J],\\n [c], rowspanx(2)[d], [e], [K],\\n [f], (), [g], [L],\\n)\\n\\n#gridx(\\n columns: 4,\\n (), (), vlinex(end: 2),\\n hlinex(stroke: yellow + 2pt),\\n colspanx(2)[a], (), [b], [J],\\n hlinex(start: 0, end: 1, stroke: yellow + 2pt),\\n hlinex(start: 1, end: 2, stroke: green + 2pt),\\n hlinex(start: 2, end: 3, stroke: red + 2pt),\\n hlinex(start: 3, end: 4, stroke: blue.lighten(50%) + 2pt),\\n [c], rowspanx(2)[d], [e], [K],\\n hlinex(start: 2),\\n [f], (), [g], [L],\\n)\\n
\\nYou can also bulk-customize lines by specifying map-hlines: h => new_hline
and map-vlines: v => new_vline
. This includes any automatically generated lines. For example:
#import \\"@preview/tablex:0.0.9\\": tablex, colspanx, rowspanx\\n\\n#tablex(\\n columns: 3,\\n map-hlines: h => (..h, stroke: blue),\\n map-vlines: v => (..v, stroke: green + 2pt),\\n colspanx(2)[a], (), [b],\\n [c], rowspanx(2)[d], [ed],\\n [f], (), [g]\\n)\\n
\\nCells can be customized entirely. Instead of specifying content (e.g. [text]
) as a table item, you can specify cellx(property: a, property: b, ...)[text]
, which allows you to customize properties, such as:
colspan: 2
(same as using colspanx(2, ...)[...]
)rowspan: 3
(same as using rowspanx(3, ...)[...]
)align: center
(override whole-table alignment for this cell)fill: blue
(fill just this cell with that color)inset: 0pt
(override inset/internal padding for this cell - note that this can look off unless you use auto columns and rows)x: 5
(arbitrarily place the cell at the given column, beginning at 0 - may error if conflicts occur)y: 6
(arbitrarily place the cell at the given row, beginning at 0 - may error if conflicts occur)Additionally, instead of specifying content to the cell, you can specify a function (column, row) => content
, allowing each cell to be aware of where it\'s positioned. (Note that positions are recorded in the cell\'s .x
and .y
attributes, and start as auto
unless you specify otherwise.)
For example:
\\n#import \\"@preview/tablex:0.0.9\\": tablex, cellx, colspanx, rowspanx\\n\\n#tablex(\\n columns: 3,\\n fill: red,\\n align: right,\\n colspanx(2)[a], (), [beeee],\\n [c], rowspanx(2)[d], cellx(fill: blue, align: left)[e],\\n [f], (), [g],\\n\\n // place this cell at the first column, seventh row\\n cellx(colspan: 3, align: center, x: 0, y: 6)[hi I\'m down here]\\n)\\n
\\nTo customize multiple cells at once, you have a few options:
\\nmap-cells: cell => cell
(given a cell, returns a new cell). You can use this to customize the cell\'s attributes, but also to change its positions (however, avoid doing that as it can easily generate conflicts). You can access the cell\'s position with cell.x
and cell.y
. All other attributes are also accessible and changeable (see the Reference
further below for a list). Return something like (..cell, fill: blue)
, for example, to ensure the other properties (including the cell type marker) are kept. (Calling cellx
here is not necessary. If overriding the cell\'s content, use content: [whatever]
). This is useful if you want to, for example, customize a cell\'s fill color based on its contents, or add some content to every cell, or something similar.
map-rows: (row_index, cells) => cells
(given a row index and all cells in it, return a new array of cells). Allows customizing entire rows, but note that the cells in the cells
parameter can be none
if they\'re some position occupied by a colspan or rowspan of another cell. Ensure you return the cells in the order you were given, including the none
s, for best results. Also, you cannot move cells here to another row. You can change the cells\' columns (by changing their x
property), but that will certainly generate conflicts if any col/rowspans are involved (in general, you cannot bulk-change col/rowspans without map-cells
).
map-cols: (col_index, cells) => cells
(given a column index and all cells in it, return a new array of cells). Similar to map-rows
, but for customizing columns. You cannot change the column of any cell here. (To do that, map-cells
is required.) You can, however, change its row (with y
, but do that sparingly), and, of course, all other properties.
Note: Execution order is map-cells
=> map-rows
=> map-cols
.
Example:
\\n#import \\"@preview/tablex:0.0.9\\": tablex, colspanx, rowspanx\\n\\n#tablex(\\n columns: 4,\\n auto-vlines: true,\\n\\n // make all cells italicized\\n map-cells: cell => {\\n (..cell, content: emph(cell.content))\\n },\\n\\n // add some arbitrary content to entire rows\\n map-rows: (row, cells) => cells.map(c =>\\n if c == none {\\n c // keeping \'none\' is important\\n } else {\\n (..c, content: [#c.content\\\\ *R#row*])\\n }\\n ),\\n\\n // color cells based on their columns\\n // (using \'fill: (column, row) => color\' also works\\n // for this particular purpose)\\n map-cols: (col, cells) => cells.map(c =>\\n if c == none {\\n c\\n } else {\\n (..c, fill: if col < 2 { blue } else { yellow })\\n }\\n ),\\n\\n colspanx(2)[a], (), [b], [J],\\n [c], rowspanx(2)[dd], [e], [K],\\n [f], (), [g], [L],\\n)\\n
\\nAnother example (summing columns):
\\n#gridx(\\n columns: 3,\\n rows: 6,\\n fill: (col, row) => (blue, red, green).at(calc.rem(row + col - 1, 3)),\\n map-cols: (col, cells) => {\\n let last = cells.last()\\n last.content = [\\n #cells.slice(0, cells.len() - 1).fold(0, (acc, c) => if c != none { acc + eval(c.content.text) } else { acc })\\n ]\\n last.fill = aqua\\n cells.last() = last\\n cells\\n },\\n [0], [5], [10],\\n [1], [6], [11],\\n [2], [7], [12],\\n [3], [8], [13],\\n [4], [9], [14],\\n [s], [s], [s]\\n)\\n
\\nFilled cells will partially overlap with horizontal lines above them (see https://github.com/PgBiel/typst-tablex/issues/4).
\\nTable lines don\'t play very well with column and row gutter when a colspan or rowspan is used. They may be missing or be cut off by gutters.
\\nRepeatable table headers might not behave properly depending on the size of your document or other factors (https://github.com/PgBiel/typst-tablex/issues/43).
\\nUsing tablex (especially when using repeatable header rows) may cause a warning, \\"layout did not converge within 5 attempts\\", to appear on recent Typst versions (https://github.com/PgBiel/typst-tablex/issues/38). This warning is due to how tablex works internally and is not your fault (in principle), so don\'t worry too much about it (unless you\'re sure it\'s not tablex that is causing this).
\\nRows with fractional height (such as 2fr
) have zero height if the table spans more than one page. This is because fractional row heights are calculated on the available height of the first page of the table, which is something that the default #table
can circumvent using internal code. This won\'t be fixed for now. (Columns with fractional width work fine, provided all pages the table is in have the same width, and the page width isn\'t auto
(which forces fractional columns to be 0pt, even in the default #table
).)
Rotation (via Typst\'s #rotate
) of text only affects the visual appearance of the text on the page, but does not change its dimensions as they factor into the layout.\\nThis leads to certain visual issues, such as rotated text potentially overflowing the cell height without being hyphenated or, inversely, being hyphenated even though there is enough space vertically (https://github.com/PgBiel/typst-tablex/issues/59).\\nThis is a known issue with Typst (perhaps, in the future, #rotate
may get a setting to affect layout).\\nAs a workaround for the text hyphenation problem, the content can be boxed (and thus grouped together) with #box
(e.g., rowspanx(7, box(rotate(-90deg, [*donothyphenatethis*])))
), or hyphenation can be prevented by setting #text(hyphenate: false, ...)
(e.g., colspanx(2, text(hyphenate: false, rotate(-90deg, [*donothyphenatethis*])))
), as also discussed in https://github.com/PgBiel/typst-tablex/issues/59;\\nanother alternative is to use #place
, e.g. aligning to center + horizon
: cellx(place(center + horizon, rotate(-90deg, [*donothyphenatethis*])))
, which probably allows the most control over the in-cell layout, since it simply draws the rotated content without having it occupy any space (letting you define that by yourself, e.g. using box(width: 1em, height: 2em, place(...))
).
rotatex
function which produces a rotated element with the appropriate sizes, such that tablex may recognize its size accordingly and avoid visual glitches.tablex
can potentially be slower and/or take longer to compile than the default table
(especially when the table spans a lot of pages). Please use the latest Typst version to reduce this problem (each version has been bringing further improvements in this sense). Still, we are looking for ways to better optimize the library (see more discussion at https://github.com/PgBiel/typst-tablex/issues/5 - feel free to give some input!). However, re-compilation is usually fine thanks to Typst\'s built-in memoization.
The internals of the library still aren\'t very well documented; I plan on adding more info about this eventually.
\\nPlease open a GitHub issue for anything weird you come across (make sure others haven\'t reported it first).
\\ncellx
: Represents a table cell, and is initialized as follows:
#let cellx(content,\\n x: auto, y: auto,\\n rowspan: 1, colspan: 1,\\n fill: auto, align: auto,\\n inset: auto,\\n fit-spans: auto\\n) = (\\n tablex-dict-type: \\"cell\\",\\n content: content,\\n rowspan: rowspan,\\n colspan: colspan,\\n align: align,\\n fill: fill,\\n inset: inset,\\n fit-spans: fit-spans,\\n x: x,\\n y: y,\\n)\\n
\\nwhere:
\\ntablex-dict-type
is the type markercontent
is the cell\'s content (either content
or a function with (col, row) => content
)rowspan
is how many rows this cell spans (default 1)colspan
is how many columns this cell spans (default 1)align
is this cell\'s align override, such as \\"center\\" (default auto
to follow the rest of the table)fill
is this cell\'s fill override, such as \\"blue\\" (default auto
to follow the rest of the table)inset
is this cell\'s inset override, such as 5pt
(default auto
to follow the rest of the table)fit-spans
allows overriding the table-wide fit-spans
setting for this specific cell (e.g. if this cell has a colspan
greater than 1, fit-spans: (x: true)
will cause it to not affect the sizes of auto
columns).x
is the cell\'s column index (0..len-1) - auto
indicates it wasn\'t assigned yety
is the cell\'s row index (0..len-1) - auto
indicates it wasn\'t assigned yethlinex
: represents a horizontal line:
#let hlinex(\\n start: 0, end: auto, y: auto,\\n stroke: auto,\\n stop-pre-gutter: auto, gutter-restrict: none,\\n stroke-expand: true,\\n expand: none\\n) = (\\n tablex-dict-type: \\"hline\\",\\n start: start,\\n end: end,\\n y: y,\\n stroke: stroke,\\n stop-pre-gutter: stop-pre-gutter,\\n gutter-restrict: gutter-restrict,\\n stroke-expand: stroke-expand,\\n expand: expand,\\n parent: none,\\n)\\n
\\nwhere:
\\ntablex-dict-type
is the type markerstart
is the column index where the hline starts from (default 0
, a.k.a. the beginning)end
is the last column the hline touches (default auto
, a.k.a. all the way to the end)\\ncolspan
larger than 1, even if their spans (start
-end
) include that cell.y
is the index of the row at the top of which the hline is drawn. (Defaults to auto
, a.k.a. depends on where you placed the hline
among the table items - it\'s always on the top of the row below the current one.)stroke
is the hline\'s stroke override (defaults to auto
, a.k.a. follow the rest of the table).stop-pre-gutter
: When true
, the hline will not be drawn over gutter (which is the default behavior of tables). Defaults to auto
which is essentially false
(draw over gutter).gutter-restrict
: Either top
, bottom
, or none
. Has no effect if row-gutter
is set to none
. Otherwise, defines if this hline
should be drawn only on the top of the row gutter (top
); on the bottom (bottom
); or on both the top and the bottom (none
, the default). Note that top
and bottom
are alignment values (not strings).stroke-expand
: When true
, the hline will be extended as necessary to cover the stroke of the vlines going through either end of the line. Defaults to true
.expand
: Optionally extend the hline by an arbitrary length. When none
, it is not expanded. When a length (such as 5pt
), it is expanded by that length on both ends. When an array of two lengths (such as (5pt, 10pt)
), it is expanded to the left by the first length (in this case, 5pt
) and to the right by the second (in this case, 10pt
). Defaults to none
.parent
: An internal attribute determined when splitting lines among cells. (It should always be none
on user-facing interfaces.)vlinex
: represents a vertical line:
#let vlinex(\\n start: 0, end: auto, x: auto,\\n stroke: auto,\\n stop-pre-gutter: auto, gutter-restrict: none,\\n stroke-expand: true,\\n expand: none\\n) = (\\n tablex-dict-type: \\"vline\\",\\n start: start,\\n end: end,\\n x: x,\\n stroke: stroke,\\n stop-pre-gutter: stop-pre-gutter,\\n gutter-restrict: gutter-restrict,\\n stroke-expand: stroke-expand,\\n expand: expand,\\n parent: none,\\n)\\n
\\nwhere:
\\ntablex-dict-type
is the type markerstart
is the row index where the vline starts from (default 0
, a.k.a. the top)end
is the last row the vline touches (default auto
, a.k.a. all the way to the bottom)\\nrowspan
larger than 1, even if their spans (start
-end
) include that cell.x
is the index of the column to the left of which the vline is drawn. (Defaults to auto
, a.k.a. depends on where you placed the vline
among the table items.)\\nvline
to be placed after all columns, its x
value will be equal to the amount of columns (which isn\'t a valid column index, but it\'s what is used here).stroke
is the vline\'s stroke override (defaults to auto
, a.k.a. follow the rest of the table).stop-pre-gutter
: When true
, the vline will not be drawn over gutter (which is the default behavior of tables). Defaults to auto
which is essentially false
(draw over gutter).gutter-restrict
: Either left
, right
, or none
. Has no effect if column-gutter
is set to none
. Otherwise, defines if this vline
should be drawn only to the left of the column gutter (left
); to the right (right
); or on both the left and the right (none
, the default). Note that left
and right
are alignment values (not strings).stroke-expand
: When true
, the vline will be extended as necessary to cover the stroke of the hlines going through either end of the line. Defaults to true
.expand
: Optionally extend the vline by an arbitrary length. When none
, it is not expanded. When a length (such as 5pt
), it is expanded by that length on both ends. When an array of two lengths (such as (5pt, 10pt)
), it is expanded towards the top by the first length (in this case, 5pt
) and towards the bottom by the second (in this case, 10pt
). Defaults to none
.parent
: An internal attribute determined when splitting lines among cells. (It should always be none
on user-facing interfaces.)The occupied
type is an internal type used to represent cell positions occupied by cells with colspan
or rowspan
greater than 1.
Use is-tablex-cell
, is-tablex-hline
, is-tablex-vline
and is-tablex-occupied
to check if a particular object has the corresponding type marker.
colspanx
and rowspanx
are shorthands for setting the colspan
and rowspan
attributes of cellx
. They can also be nested (one given as an argument to the other) to combine their properties (e.g., colspanx(2)(rowspanx(3)[a])
). They accept all other cell properties with named arguments. For example, colspanx(2, align: center)[b]
is equivalent to cellx(colspan: 2, align: center)[b]
.
gridx
is equivalent to tablex
with auto-lines: false
; see below.
tablex:
The main function for creating a table with this library:
#let tablex(\\n columns: auto, rows: auto,\\n inset: 5pt,\\n align: auto,\\n fill: none,\\n stroke: auto,\\n column-gutter: auto, row-gutter: auto,\\n gutter: none,\\n repeat-header: false,\\n header-rows: 1,\\n header-hlines-have-priority: true,\\n auto-lines: true,\\n auto-hlines: auto,\\n auto-vlines: auto,\\n map-cells: none,\\n map-hlines: none,\\n map-vlines: none,\\n map-rows: none,\\n map-cols: none,\\n ..items\\n) = {\\n// ...\\n}\\n
\\nParameters:
\\ncolumns
: The sizes (widths) of each column. They work just like regular table
\'s columns, and can be:
1pt
, 2em
, 100%
, ...), including fractional (2fr
), to specify the width of each column\\ncolumns: (2pt, 3em)
will give you two columns: one with a width of 2pt
and another with the width of 3em
(3 times the font size).\\n49%
, are considered fixed widths as they are always multiplied by the full page width (minus margins) for columns. Thus, a column with a size of 100%
would span your whole page (even if there are other columns).auto
may be specified to automatically resize the column based on the largest width of its contents, if possible - this is the most common column width choice, as it just delegates the column sizing job to tablex!\\nauto
-sized column contains two cells with Hello world!
and Bye!
as contents, tablex will try to make the column large enough for Hello world!
(the cell with largest potential width) to fit in a single line.auto
columns when they would otherwise cause the table to overrun the page\'s normal width (i.e. the width between the page\'s lateral margins).\\n2pt
, 3em
or 49%
) are not subject to this size reduction; thus, if you specify all columns\' widths with fixed lengths, your table could become larger than the page\'s width! (In such a case, auto
columns would be reduced to a size of zero, as there would be no available space anymore!)1fr
, 2fr
...) for columns, the available space (remaining page width, after calculating all other columns\' sizes) is divided between them, weighted on the fraction value of each column.\\n(1fr, 2fr)
, the available space will be divided by 3 (1 + 2), and the first column will have 1/3 of the space, while the second will have 2/3.\\n(1fr, 1fr)
would cause both columns to have equal length (1/2 and 1/2 of the available space).1fr
), it will occupy the entire available space.auto
width (the columns will have width zero) - this is because those pages theoretically have infinite width (they can expand indefinitely), so having columns spanning the entire available width is then impossible!columns: 2pt
is equivalent to columns: (2pt,)
, which translates to a single column of width 2pt
.4
), as a shorthand for (auto,) * 4
(that many auto
columns)\\ncolumns: 4
will give you four auto
columns).rows
: The sizes (heights) of each row. They follow the exact same format as columns
, except that the \\"available space\\" is infinite (auto rows can expand as much as is needed, as the table can add rows over multiple pages).
49%
) are fixed width lengths, like in columns
; however, here, they are multiplied by the page\'s full height (minus margins), and not width.auto
, the extra ones will also be auto
, for example.)\\n(# columns)
multiplied by (# rows)
. In this case, you will have an extra row for each (# columns)
cells after the limit. In other words, the amount of columns is always fixed (determined by the amount of widths in the array given to columns
), but the amount of rows can vary depending on your input of cells to the table.y
coordinate can also cause your table to have extra rows (enough rows to reach the cell at that coordinate).#table
.inset
: Inset/internal padding to give to each cell. Can be either a length (same inset from the top, bottom, left and right of the cell), or a dictionary (e.g. (left: 5pt, right: 10pt, bottom: 2pt, top: 4pt)
, or even (left: 5pt, rest: 10pt)
to apply the same value to the remaining sides). Defaults to 5pt
(the #table
default).
align
: How to align text in the cells. Defaults to auto
, which inherits alignment from the outer context. Must be either auto
, an alignment
(such as left
or top
), a 2d alignment
(such as left + top
), an array
of alignment/2d alignment (one for each column in the table - if there are more columns than alignment values, they will alternate); or a function (column, row) => alignment/2d alignment
(to customize for each individual cell).
fill
: Color with which to fill cells\' backgrounds. Defaults to none
, or no fill. Must be either a color
, such as blue
; an array
of colors (one for each column in the table - if there are more columns than colors, they will alternate); or a function (column, row) => color
(to customize for each individual cell).
stroke
: Indicates how to draw the table lines. Defaults to the current line styles in the document. For example: 5pt + red
to change the color and the thickness.
column-gutter
: optional separation (length) between columns (such as 5pt
). Defaults to none
(disable). At the moment, looks a bit ugly if your table has a hline
attempting to cross a colspan
.
row-gutter
: optional separation (length) between rows. Defaults to none
(disable). At the moment, looks a bit ugly if your table has a vline
attempting to cross a rowspan
.
gutter
: Sets a length to both column-
and row-gutter
at the same time (overridable by each).
repeat-header
: Controls header repetition. If set to true
, the first row (or the amount of rows specified in header-rows
), including its rowspans, is repeated across all pages this table spans. If set to false
(default), the aforementioned header row is not repeated in any page. If set to an integer (such as 4
), repeats for that many pages after the first, then stops. If set to an array of integers (such as (3, 4)
), repeats only on those pages relative to the table\'s first page (page 1 here is where the table is, so adding 1
to said array has no effect).
header-rows
: minimum amount of rows for the repeatable\\nheader. 1 by default. Automatically increases if\\none of the cells is a rowspan that would go beyond the\\ngiven amount of rows. For example, if 3 is given,\\nthen at least the first 3 rows will repeat.
header-hlines-have-priority
: if true
, the horizontal\\nlines below the header being repeated take priority\\nover the rows they appear atop of on further pages.\\nIf false
, they draw their own horizontal lines.\\nDefaults to true
.
true
. If this option is false
, the header will repeat, but the blue hline will not.rtl
: if true, the table is horizontally flipped. That is, cells and lines are placed in the opposite order (starting from the right), and horizontal lines are flipped.\\nThis is meant to simulate the behavior of default Typst tables when set text(dir: rtl)
is used,\\nand is useful when writing in a language with a RTL (right-to-left) script.\\nDefaults to false
.
auto-lines
: Shorthand to apply a boolean to both auto-hlines
and auto-vlines
at the same time (overridable by each). Defaults to true
.
auto-hlines
: If true
, draw a horizontal line on every line where you did not manually draw one; if false
, no hlines other than the ones you specify (via hlinex
) are drawn. Defaults to auto
(follows auto-lines
, which in turn defaults to true
).
auto-vlines
: If true
, draw a vertical line on every line where you did not manually draw one; if false
, no vlines other than the ones you specify (via vlinex
) are drawn. Defaults to auto
(follows auto-lines
, which in turn defaults to true
).
map-cells
: A function which takes a single cellx
and returns another cellx
, or a content
which is converted to cellx
by cellx[#content]
. You can customize the cell in pretty much any way using this function; just take care to avoid conflicting with already-placed cells if you move it.
map-hlines
: A function which takes each horizontal line object (hlinex
) and returns another, optionally modifying its properties. You may also change its row position (y
). Note that this is also applied to lines generated by auto-hlines
.
map-vlines
: A function which takes each horizontal line object (vlinex
) and returns another, optionally modifying its properties. You may also change its column position (x
). Note that this is also applied to lines generated by auto-vlines
.
map-rows
: A function mapping each row of cells to new values or modified properties.\\nTakes (row_num, cell_array)
and returns\\nthe modified cell_array
. Note that, with your function, they\\ncannot be sent to another row. Also, please preserve the order of the cells. This is especially important given that cells may be none
if they\'re actually a position taken by another cell with colspan/rowspan. Make sure the none
values are in the same indexes when the array is returned.
map-cols
: A function mapping each column of cells to new values or modified properties.\\nTakes (col_num, cell_array)
and returns\\nthe modified cell_array
. Note that, with your function, they\\ncannot be sent to another column. Also, please preserve the order of the cells. This is especially important given that cells may be none
if they\'re actually a position taken by another cell with colspan/rowspan. Make sure the none
values are in the same indexes when the array is returned.
fit-spans
: either a dictionary (x: bool, y: bool)
or just bool
(e.g. just true
is converted to (x: true, y: true)
). When given (x: true)
, colspans won\'t affect the sizes of auto
columns. When given (y: true)
, rowspans won\'t affect the sizes of auto
rows. By default, this is equal to (x: false, y: false)
(equivalent to just false
), which means that colspans will cause the last spanned auto
column to expand (depending on the contents of the cell) and rowspans will cause the last spanned auto
row to expand similarly.
(x: true)
to prevent unexpected expansion of auto
columns after using a colspan, which can happen when a colspan spans both a fractional-size column (e.g. 1fr
) and an auto
-sized column. Can be applied to rows too through (y: true)
or (x: true, y: true)
, if needed, however.NOTE: Please use Typst\'s built-in tables instead of tablex (starting with Typst 0.11.0).\\nMost of tablex\'s features were implemented in Typst\'s tables by the author of tablex.
\\nfit-spans
option to tablex
and cellx
(https://github.com/PgBiel/typst-tablex/pull/111)\\n(x: bool, y: bool)
. When set to (x: true)
, colspans won\'t affect the sizes of auto
columns. When set to (y: true)
, rowspans won\'t affect the sizes of auto
rows.false
, equivalent to (x: false, y: false)
, that is, colspans and rowspans affect the sizes of auto
tracks (columns and rows) by default (expanding the last spanned track if the colspan/rowspan is too large).auto
-sized track to inadvertently expand.auto
column sizing received multiple improvements and bug fixes. Tables should now have more natural column widths. (https://github.com/PgBiel/typst-tablex/pull/109, https://github.com/PgBiel/typst-tablex/pull/116)\\nauto
columns being needlessly expanded in some cases (https://github.com/PgBiel/typst-tablex/issues/56, https://github.com/PgBiel/typst-tablex/issues/78)\\nfit-spans
option as needed, or use fixed-size columns instead.tablex
tables might now become up to 20% faster to cold compile. Give it a shot!auto
height (https://github.com/PgBiel/typst-tablex/pull/108).I have begun work on bringing many tablex improvements to built-in Typst tables! In that regard, you can now sponsor my work on tablex and improving Typst tables via GitHub Sponsors! Consider taking a look :)
\\nline
in tablex cells would misbehave (https://github.com/PgBiel/typst-tablex/issues/80)\\ntypst.toml
for better discoverability (https://github.com/PgBiel/typst-tablex/issues/91)rtl: true
(https://github.com/PgBiel/typst-tablex/issues/58).\\nset text(dir: rtl)
, however we can\'t detect that setting from tablex at this moment (it isn\'t currently possible to fetch set rules in Typst).#tablex(rtl: true, ...)
to flip your table horizontally if you\'re writing a document in RTL (right-to-left) script. (You can use e.g. #let old-tablex = tablex
followed by #let tablex(..args) = old-tablex(rtl: true, ..args)
to not have to repeat the rtl
parameter every time.)box
\'s dictionary inset syntax on tablex (https://github.com/PgBiel/typst-tablex/issues/54).\\n#tablex(inset: (left: 5pt, top: 10pt, rest: 2pt), ...)
.#rotate
problems to \\"Known Issues\\" in the README (https://github.com/PgBiel/typst-tablex/pull/60).columns
and rows
(https://github.com/PgBiel/typst-tablex/issues/53).layout()
function.\\nauto
width (https://github.com/PgBiel/typst-tablex/issues/44; https://github.com/PgBiel/typst-tablex/issues/39)auto
-sized pages (https://github.com/PgBiel/typst-tablex/issues/47).em
strokes and other types of strokes (https://github.com/PgBiel/typst-tablex/issues/49).typst.toml
to support Typst v0.6.0\'s soon-to-be-released package manager (see https://github.com/PgBiel/typst-tablex/issues/22).hlinex(gutter-restrict: top)
causing the hline to just disappear (https://github.com/PgBiel/typst-tablex/issues/20).gutter-restrict
lines disappearing when there\'s no gutter (https://github.com/PgBiel/typst-tablex/issues/21).fill:
and align:
now accept arrays of values for each column (https://github.com/PgBiel/typst-tablex/issues/13).\\nfill: (red, blue)
would fill the first column with red, the second column with blue, and any further columns would alternate between the two fill colors.auto
rows and columns when a rowspan or colspan was used (https://github.com/PgBiel/typst-tablex/issues/11).auto
column when it was too long (https://github.com/PgBiel/typst-tablex/issues/6).stroke-expand: false
on your lines.expand: (length, length)
; e.g. expand: (5pt, 10pt)
will increase your horizontal line 5pt to the left and 10pt to the right (or, for a vertical line, 5pt to the top and 10pt to the bottom).\\nInitial release.
\\ntablex
, cellx
, hlinex
, vlinex
gridx
, rowspanx
, colspanx
#table
parity\\ncolumns:
, rows:
\\nauto
columns and rowsauto
auto
columns based on available spacefill
\\ncolor
for general fill)(column, row) => color
)align
\\nalignment
and 2d alignment
apply to all cells)(column, row) => alignment/2d alignment
)inset
gutter
\\ncolumn-gutter
row-gutter
stop-pre-gutter
: Makes the hline/vline not transpose gutter boundariesgutter-restrict
: Makes the hline/vline not draw on both sides of a gutter boundary, and instead pick one (top/bottom; left/right)stroke
\\nnone
for no stroke#tablex
\\ncellx
, hlinex
, vlinex
)hlinex
, vlinex
\\nstroke
colspanx
, rowspanx
\\nhlinex
and vlinex
with end: auto
cellx(colspanx:, rowspanx:)
colspanx(rowspanx())
)colspanx(2, align: left)[a]
)repeat-header
: Control header repetition\\ntrue
: Repeat on all pagesfalse
(default): Do not repeatheader-rows
: Indicate what to consider as a \\"header\\"\\nnone
or 0
: no header (disables header repetition regardless of repeat-header
)cellx
\\ncellx(x:, y:)
align
overridefill
overrideinset
override\\nauto
cols/rowsmap-cells
on a single cell)auto-hlines
- true
to place on all lines without hlines, false
otherwiseauto-vlines
- similarauto-lines
- controls both simultaneously (defaults to true
)map-cells
- Customize every single cellmap-hlines
- Customize each horizontal linemap-vlines
- Customize each vertical linemap-rows
- Customize entire rows of cellsmap-cols
- Customize entire columns of cellsTablex is licensed under MIT or Apache-2.0, at your option (see the files LICENSE-MIT
and LICENSE-APACHE
).
Convert Arabic numbers to Chinese characters.
\\n#import \\"@preview/a2c-nums:0.0.1\\": int-to-cn-num, int-to-cn-ancient-num, int-to-cn-simple-num, num-to-cn-currency\\n\\n#int-to-cn-num(1234567890)\\n\\n#int-to-cn-ancient-num(1234567890)\\n\\n#int-to-cn-simple-num(2024)\\n\\n#num-to-cn-currency(1234567890.12)\\n
\\nConvert an integer to Chinese number. ex: #int-to-cn-num(123)
will be 一百二十三
Convert an integer to ancient Chinese number. ex: #int-to-cn-ancient-num(123)
will be 壹佰贰拾叁
Convert an integer to simpple Chinese number. ex: #int-to-cn-simple-num(2024)
will be 二〇二四
Convert a number to Chinese currency. ex: #int-to-cn-simple-num(1234.56)
will be 壹仟贰佰叁拾肆元伍角陆分
Reference demo.typ for more details please.
\\n","description":"Convert Arabic numbers to Chinese characters. usage\\n#import \\"@preview/a2c-nums:0.0.1\\": int-to-cn-num, int-to-cn-ancient-num, int-to-cn-simple-num, num-to-cn-currency\\n\\n#int-to-cn-num(1234567890)\\n\\n#int-to-cn-ancient-num(1234567890)\\n\\n#int-to-cn-simple-num(2024)\\n\\n#num-to-cn-currency…","guid":"https://typst.app/universe/package/a2c-nums","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2024-01-08T10:13:47.309Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"minitoc (0.1.0) | An outline function just for one section and nothing else","url":"https://typst.app/universe/package/minitoc","content":"This package provides the minitoc
command that does the same thing as the outline
command but only for headings under the heading above it.
This is inspired by minitoc package for LaTeX.
\\n#import \\"@preview/minitoc:0.1.0\\": *\\n#set heading(numbering: \\"1.1\\")\\n\\n#outline()\\n\\n= Heading 1\\n\\n#minitoc()\\n\\n== Heading 1.1\\n\\n#lorem(20)\\n\\n=== Heading 1.1.1\\n\\n#lorem(30)\\n\\n== Heading 1.2\\n\\n#lorem(10)\\n\\n= Heading 2\\n\\n
\\nThis produces
\\nThe minitoc
function has the following signature:
#let minitoc(\\n title: none, target: heading.where(outlined: true),\\ndepth: none, indent: none, fill: repeat([.])\\n) { /* .. */ }\\n
\\nThis is designed to be as close to the outline
funtions as possible. The arguments are:
outline.title
.outline.target
outline.indent
and is passed directly to itoutline.fill
Because minitoc
uses outline
, if you apply numbering to the title of outline with #show outline: set heading(numbering: \\"1.\\")
or similar, any title in minitoc
will be numbered and be a level 1 heading. This cannot be changed with #show outline: set heading(level: 3)
or similar unfortunately.
This script provides a simple way to render text with ANSI escape sequences. Package ansi-render
provides a function ansi-render
, and a dictionary of themes terminal-themes
.
contribution is welcomed!
\\n#import \\"@preview/ansi-render:0.6.1\\": *\\n\\n#ansi-render(\\n string,\\n font: string or none,\\n size: length,\\n width: auto or relative length,\\n height: auto or relative length,\\n breakable: boolean,\\n radius: relative length or dictionary,\\n inset: relative length or dictionary,\\n outset: relative length or dictionary,\\n spacing: relative length or fraction,\\n above: relative length or fraction,\\n below: relative length or fraction,\\n clip: boolean,\\n bold-is-bright: boolean,\\n theme: terminal-themes.theme,\\n)\\n
\\nstring
- string with ANSI escape sequencesfont
- font name or none, default is Cascadia Code
, set to none
to use the same font as raw
size
- font size, default is 1em
bold-is-bright
- boolean, whether bold text is rendered with bright colors, default is false
theme
- theme, default is vscode-light
block
function with the same default value, only affects outmost block layout:\\nwidth
height
breakable
radius
inset
outset
spacing
above
below
clip
see themes
\\n#ansi-render(\\n\\"\\\\u{1b}[38;2;255;0;0mThis text is red.\\\\u{1b}[0m\\n\\\\u{1b}[48;2;0;255;0mThis background is green.\\\\u{1b}[0m\\n\\\\u{1b}[38;2;255;255;255m\\\\u{1b}[48;2;0;0;255mThis text is white on a blue background.\\\\u{1b}[0m\\n\\\\u{1b}[1mThis text is bold.\\\\u{1b}[0m\\n\\\\u{1b}[4mThis text is underlined.\\\\u{1b}[0m\\n\\\\u{1b}[38;2;255;165;0m\\\\u{1b}[48;2;255;255;0mThis text is orange on a yellow background.\\\\u{1b}[0m\\",\\ninset: 5pt, radius: 3pt,\\ntheme: terminal-themes.vscode\\n)\\n
\\n#ansi-render(\\n\\"\\\\u{1b}[38;5;196mRed text\\\\u{1b}[0m\\n\\\\u{1b}[48;5;27mBlue background\\\\u{1b}[0m\\n\\\\u{1b}[38;5;226;48;5;18mYellow text on blue background\\\\u{1b}[0m\\n\\\\u{1b}[7mInverted text\\\\u{1b}[0m\\n\\\\u{1b}[38;5;208;48;5;237mOrange text on gray background\\\\u{1b}[0m\\n\\\\u{1b}[38;5;39;48;5;208mBlue text on orange background\\\\u{1b}[0m\\n\\\\u{1b}[38;5;255;48;5;0mWhite text on black background\\\\u{1b}[0m\\",\\ninset: 5pt, radius: 3pt,\\ntheme: terminal-themes.vscode\\n)\\n
\\n#ansi-render(\\n\\"\\\\u{1b}[31;1mHello \\\\u{1b}[7mWorld\\\\u{1b}[0m\\n\\n\\\\u{1b}[53;4;36mOver and \\\\u{1b}[35m Under!\\n\\\\u{1b}[7;90mreverse\\\\u{1b}[101m and \\\\u{1b}[94;27mreverse\\",\\ninset: 5pt, radius: 3pt,\\ntheme: terminal-themes.vscode\\n)\\n
\\n// uses the font that supports ligatures\\n#ansi-render(read(\\"test.txt\\"), inset: 5pt, radius: 3pt, font: \\"Cascadia Code\\", theme: terminal-themes.putty)\\n
\\nA typst package for rendering text into polytonic Greek using a hopefully-intuitive transliteration scheme.
\\nFirst, be sure you include the package at the top of your typst file:
\\n@import \\"preview/polytonoi@0.1.0: *\\n
\\nThe package currently exposes one function, #ptgk(<string>)
, which will convert <string>
into polytonic Greek text in the same location where the function appears in the typst document.
For example: #ptgk(\\"polu/s\\")
would render: πολύς
NOTE: Quotation marks within the function call (see above example) are mandatory, and the code will not work without them.
\\nWhere possible, Greek letters have been linked with their closest Roman equivalent (e.g. a --\x3e α, b --\x3e β). Where not possible, I\'ve tried to stick to common convention, such as what is used by the Perseus Project for their transliteration. A couple letters (ξ and ψ) are made up of two letters (ks
and ps
respectively), which the #ptgk()
function handles as special cases. See below for the full transliteration scheme.
As of now, the text is processed as a string, which means that any formatting markup (such as _
or *
) is not included in how the text is rendered, and is instead passed through and will display literally. To apply any kind of formatting to the Greek text, the markup or commands must be put outside the text passed to the function. Compare the following two examples to see how this works:
#ptgk(\\"_Arxh\\\\_\\")
would display as _Ἀρχὴ_
whereas
\\n_#ptgk(\\"Arxh\\\\\\")_
would display as Ἀρχὴ
| Roman letter | Greek result | Notes |\\n|--------------|--------------|-------|\\n| a | α | |\\n| b | β | |\\n| g | γ | |\\n| d | δ | |\\n| e | ε | |\\n| z | ζ | |\\n| h | η | |\\n| q | θ | |\\n| i | ι | |\\n| k | κ | |\\n| l | λ | |\\n| m | μ | |\\n| n | ν | |\\n| ks | ξ | |\\n| o | ο | |\\n| p | π | |\\n| r | ρ | |\\n| s | σ/ς | Renders as final sigma automatically |\\n| t | τ | |\\n| u | υ | |\\n| v | φ | |\\n| x | χ | |\\n| ps | ψ | |\\n| w | ω | |
\\nUpper-case letters are handled the same way, just with an upper-case letter as input. The upper-case versions of the two \\"combined\\" letters (Ξ and Ψ) can be entered either as \\"KS\\"/\\"PS\\" or \\"Ks\\"/\\"Ps\\".
\\nAs mentioned above, this package will automatically put a smooth breathing mark on a vowel that begins a word, unless that vowel is followed immediately by a second vowel. In that instance, you\'ll have to manually put the smooth breathing mark in its correct place. (This is to avoid having to code for edge cases, such as where a word starts with three vowels in a row.) By the same token, rough breathing must always be entered manually.
\\n| Input | Greek | Notes | Example |\\n|-------|-------|-------|---------|\\n| ( | rough breathing | Put before the vowel | (a
--\x3e ἁ |\\n| ) | smooth breathing | Put before the vowel | )a
--\x3e ἀ |\\n| \\\\ | Grave / varia | Put after the vowel | a\\\\
--\x3e ὰ |\\n| / | Acute / oxia / tonos | Put after the vowel | a/
--\x3e ά |\\n| = | Tilde / perispomeni | Put after the vowel | a=
--\x3e ᾶ |\\n| | | Iota subscript | Put after the vowel | a\\\\|
--\x3e ᾳ |\\n| : | Diaresis | Put after the vowel | i:
--\x3e ϊ |
Multiple diacriticals can be added to a vowel, e.g. (h|
--\x3e ᾑ
Most Roman punctuation characters are left unchanged. The exceptions are ;
(semicolon) and ?
(question mark), which are rendered as a high dot (·) and the Greek question mark (;) respectively.
Feedback is welcome, and please don\'t hesitate to open an issue if something doesn\'t work. I\'ve tried to account for edge cases, but I certainly can\'t guarantee that I\'ve found everything.
\\n","description":"A typst package for rendering text into polytonic Greek using a hopefully-intuitive transliteration scheme. Usage\\n\\nFirst, be sure you include the package at the top of your typst file:\\n\\n@import \\"preview/polytonoi@0.1.0: *\\n\\n\\nThe package currently exposes one function, #ptgk(Chic-header (chic-hdr) is a Typst package for creating elegant headers and footers
\\nTo use this library through the Typst package manager (for Typst 0.6.0 or greater), write #import \\"@preview/chic-hdr:0.4.0\\": *
at the beginning of your Typst file. Once imported, you can start using the package by writing the instruction #show: chic.with()
and giving any of the chic functions inside the parenthesis ()
.
Important: If you are using a custom template that also needs the #show
instruction to be applied, prefer to use #show: chic()
after the template\'s #show
.
For example, the code below...
\\n#import \\"@preview/chic-hdr:0.4.0\\": *\\n\\n#set page(paper: \\"a7\\")\\n\\n#show: chic.with(\\n chic-footer(\\n left-side: strong(\\n link(\\"mailto:admin@chic.hdr\\", \\"admin@chic.hdr\\")\\n ),\\n right-side: chic-page-number()\\n ),\\n chic-header(\\n left-side: emph(chic-heading-name(fill: true)),\\n right-side: smallcaps(\\"Example\\")\\n ),\\n chic-separator(1pt),\\n chic-offset(7pt),\\n chic-height(1.5cm)\\n)\\n\\n= Introduction\\n#lorem(30)\\n\\n== Details\\n#lorem(70)\\n
\\n...will look like this:
\\nNote: For a detailed explanation of the functions and parameters, see Chic-header\'s Manual.pdf.
\\nWhile using #show: chic.with()
, you can give the following parameters inside the parenthesis:
width
: Indicates the with of headers and footers in all the document (default is 100%
).skip
: Which pages must be skipped for setting its header and footer. Other properties changed with chic-height()
or chic-offset()
are preserved. Giving a negative index causes a skip of the last pages using last page as index -1(default is ()
).even
: Header and footer for even pages. Here, only chic-header()
, chic-footer()
and chic-separator()
functions will take effect. Other functions must be given as an argument of chic()
.odd
: Sets the header and footer for odd pages. Here, only chic-header()
, chic-footer()
and chic-separator()
functions will take effect. Other functions must be given as an argument of chic()
...functions()
: These are a variable number of arguments that corresponds to Chic-header’s style functions.chic-header()
- Sets the header content.\\nv-center
: Whether to vertically align the header content, or not (default is false
).side-width
: Custom width for the sides. It can be an 3-element-array, length or relative length (default is none
and widths are set to 1fr
if a side is present).left-side
: Content displayed in the left side of the header (default is none
).center-side
: Content displayed in the center of the header (default is none
).right-side
: Content displayed in the right side of the header (default is none
).chic-footer()
- Sets the footer content.\\nv-center
: Whether to vertically align the header content, or not (default is false
).side-width
: Custom width for the sides. It can be an 3-element-array, length or relative length (default is none
and widths are set to 1fr
if a side is present).left-side
: Content displayed in the left side of the footer (default is none
).center-side
: Content displayed in the center of the footer (default is none
).right-side
: Content displayed in the right side of the footer (default is none
).chic-separator()
- Sets the separator for either the header, the footer or both.\\non
: Where to apply the separator. It can be \\"header\\"
, \\"footer\\"
or \\"both\\"
(default is \\"both\\"
).outset
: Space around the separator beyond the page margins (default is 0pt
).gutter
: How much spacing insert around the separator (default is 0.65em
).line()
, a stroke for a line()
, or a custom content element.chic-styled-separator()
- Returns a pre-made custom separator for using it in chic-separator()
\\ncolor
: Separator\'s color (default is black
).\\"double-line\\"
, \\"center-dot\\"
, \\"bold-center\\"
, or \\"flower-end\\"
.chic-height()
- Sets the height of either the header, the footer or both.\\non
: Where to change the height. It can be \\"header\\"
, \\"footer\\"
or \\"both\\"
(default is \\"both\\"
).chic-offset()
- Sets the offset of either the header, the footer or both (relative to the page content).\\non
: Where to change the offset It can be \\"header\\"
, \\"footer\\"
or \\"both\\"
(default is \\"both
).chic-page-number()
- Returns the current page number. Useful for header and footer sides
. It doesn’t take any parameters.chic-heading-name()
- Returns the next heading name in the dir
direction. The heading must have a lower or equal level than level
. If there\'re no more headings in that direction, and fill
is true
, then headings are sought in the other direction.\\ndir
: Direction for searching the next heading: \\"next\\"
(from the current page, get the next heading) or \\"prev\\"
(from the current page, get the previous heading). Default is \\"next\\"
.fill
: If there\'s no more headings in the dir
direction, indicates whether to try to get a heading in the opposite direction (default is false
).level
: Up to what level of headings should this function search (default is 2
).Header with chic-heading-name()
at left, and chic-page-number()
at right. There\'s a chic-separator()
of 1pt
only for the header.
Footer with chic-page-number()
at right, and a custom chic-separator()
showing \\"end of page (No. page)\\" between 9 ~
symbols at each side.
chic-header()
, chic-footer()
, chic-separator()
, chic-height()
, chic-offset()
, chic-page-number()
, and chic-heading-name()
functionsThanks to Slashformotion (https://github.com/slashformotion) for noticing this version bugs, and suggesting a vertical alignment for headers.
\\nchic-header()
and chic-footer()
v-center
option for chic-header()
and chic-footer()
outset
option for chic-separator()
chic-styled-separator()
functionside-width
option for chic-header()
and chic-footer()
Thanks to David (https://github.com/davidleejy) for being interested in the package and giving feedback and ideas for new parameters
\\ntype()
conditionals to met Typst 0.8.0 standardsdir
, fill
, and level
parameters to chic-heading-name()
skip
TaDa provides a set of simple but powerful operations on rows of data. A\\nfull manual is available online:\\nhttps://github.com/ntjess/typst-tada/blob/v0.1.0/docs/manual.pdf
\\nKey features include:
\\nArithmetic expressions: Row-wise operations are as simple as\\nstring expressions with field names
\\nAggregation: Any function that operates on an array of values\\ncan perform row-wise or column-wise aggregation
\\nData representation: Handle displaying currencies, floats,\\nintegers, and more with ease and arbitrary customization
\\nNote: This library is in early development. The API is subject to change\\nespecially as typst adds more support for user-defined types.\\nBackwards compatibility is not guaranteed! Handling of field info,\\nvalue types, and more may change substantially with more user feedback.
\\nTaDa can be imported as follows:
\\n#import \\"@preview/tada:0.1.0\\"\\n
\\nOption 1: You can clone the package directly into your project\\ndirectory:
\\n# In your project directory\\ngit clone https://github.com/ntjess/typst-tada.git tada\\n
\\nThen import the functionality with
\\n#import \\"./tada/lib.typ\\" \\n
\\nOption 2: If Python is available on your system, use the provided\\npackaging script to install TaDa in typst\'s local
directory:
# Anywhere on your system\\n git clone https://github.com/ntjess/typst-tada.git\\n cd typst-tada\\n \\n # Replace $XDG_CACHE_HOME with the appropriate directory based on\\n # https://github.com/typst/packages#downloads\\n python package.py ./typst.toml \\"$XDG_CACHE_HOME/typst/packages\\" \\\\\\n --namespace local\\n \\n
\\nNow, TaDa is available under the local namespace:
\\n#import \\"@local/tada:0.1.0\\"\\n
\\nTaDa provides three main ways to construct tables -- from columns, rows,\\nor records.
\\nColumns are a dictionary of field names to column values.\\nAlternatively, a 2D array of columns can be passed to\\nfrom-columns
, where values.at(0)
is a column (belongs to one\\nfield).
Records are a 1D array of dictionaries where each dictionary is\\na row.
\\nRows are a 2D array where values.at(0)
is a row (has one value\\nfor each field). Note that if rows
are given without field names,\\nthey default to (0, 1, ..$n$).
#let column-data = (\\n name: (\\"Bread\\", \\"Milk\\", \\"Eggs\\"),\\n price: (1.25, 2.50, 1.50),\\n quantity: (2, 1, 3),\\n)\\n#let record-data = (\\n (name: \\"Bread\\", price: 1.25, quantity: 2),\\n (name: \\"Milk\\", price: 2.50, quantity: 1),\\n (name: \\"Eggs\\", price: 1.50, quantity: 3),\\n)\\n#let row-data = (\\n (\\"Bread\\", 1.25, 2),\\n (\\"Milk\\", 2.50, 1),\\n (\\"Eggs\\", 1.50, 3),\\n)\\n\\n#import tada: TableData\\n#let td = TableData(data: column-data)\\n// Equivalent to:\\n#let td2 = tada.from-records(record-data)\\n// _Not_ equivalent to (since field names are unknown):\\n#let td3 = tada.from-rows(row-data)\\n\\n#to-tablex(td)\\n#to-tablex(td2)\\n#to-tablex(td3)\\n
\\nYou can pass any content
as a field\'s title
. Note: if you pass a\\nstring, it will be evaluated as markup.
#let fmt(it) = {\\n heading(outlined: false,\\n upper(it.at(0))\\n + it.slice(1).replace(\\"_\\", \\" \\")\\n )\\n}\\n\\n#let titles = (\\n // As a function\\n name: (title: fmt),\\n // As a string\\n quantity: (title: fmt(\\"Qty\\")),\\n)\\n#let td = TableData(..td, field-info: titles)\\n\\n#to-tablex(td)\\n
\\nYou can specify defaults for any field not explicitly populated by\\npassing information to field-defaults
. Observe in the last example\\nthat price
was not given a title. We can indicate it should be\\nformatted the same as name
by passing title: fmt
to\\nfield-defaults
. Note that any field that is explicitly given a\\nvalue will not be affected by field-defaults
(i.e., quantity
will\\nretain its string title \\"Qty\\")
#let defaults = (title: fmt)\\n#let td = TableData(..td, field-defaults: defaults)\\n#to-tablex(td)\\n
\\n__index
TaDa will automatically add an __index
field to each row that is\\nhidden by default. If you want it displayed, update its information to\\nset hide: false
:
// Use the helper function `update-fields` to update multiple fields\\n// and/or attributes\\n#import tada: update-fields\\n#let td = update-fields(\\n td, __index: (hide: false, title: \\"\\\\#\\")\\n)\\n// You can also insert attributes directly:\\n// #td.field-info.__index.insert(\\"hide\\", false)\\n// etc.\\n#to-tablex(td)\\n
\\ntype
Type information can have attached metadata that specifies alignment,\\ndisplay formats, and more. Available types and their metadata are:
\\nstring : (default-value: \\"\\", align: left)
\\ncontent : (display: , align: left)
\\nfloat : (align: right)
\\ninteger : (align: right)
\\npercent : (display: , align: right)
\\nindex : (align: right)
\\nWhile adding your own default types is not yet supported, you can simply\\ndefined a dictionary of specifications and pass its keys to the field
\\n#let currency-info = (\\n display: tada.display.format-usd, align: right\\n)\\n#td.field-info.insert(\\"price\\", (type: \\"currency\\"))\\n#let td = TableData(..td, type-info: (\\"currency\\": currency-info))\\n#to-tablex(td)\\n
\\ntranspose
is supported, but keep in mind if columns have different\\ntypes, an error will be a frequent result. To avoid the error,\\nexplicitly pass ignore-types: true
. You can choose whether to keep\\nfield names as an additional column by passing a string to fields-name
\\nthat is evaluated as markup:
#to-tablex(\\n tada.transpose(\\n td, ignore-types: true, fields-name: \\"\\"\\n )\\n)\\n
\\ndisplay
If your type is not available or you want to customize its display, pass\\na display
function that formats the value, or a string that accesses\\nvalue
in its scope:
#td.field-info.at(\\"quantity\\").insert(\\n \\"display\\",\\n val => (\\"/\\", \\"One\\", \\"Two\\", \\"Three\\").at(val),\\n)\\n\\n#let td = TableData(..td)\\n#to-tablex(td)\\n
\\nalign
etc.You can pass align
and width
to a given field\'s metadata to\\ndetermine how content aligns in the cell and how much horizontal space\\nit takes up. In the future, more tablex
setup arguments will be\\naccepted.
#let adjusted = update-fields(\\n td, name: (align: center, width: 1.4in)\\n)\\n#to-tablex(adjusted)\\n
\\ntablex
customizationTaDa uses tablex
to display the table. So any argument that tablex
\\naccepts can be passed to TableData as well:
#let mapper = (index, row) => {\\n let fill = if index == 0 {rgb(\\"#8888\\")} else {none}\\n row.map(cell => (..cell, fill: fill))\\n}\\n#let td = TableData(\\n ..td,\\n tablex-kwargs: (\\n map-rows: mapper, auto-vlines: false\\n ),\\n)\\n#to-tablex(td)\\n
\\nYou can select a subset of fields or rows to display:
\\n#import tada: subset\\n#to-tablex(\\n subset(td, indexes: (0,2), fields: (\\"name\\", \\"price\\"))\\n)\\n
\\nNote that indexes
is based on the table\'s __index
column, not it\'s\\npositional index within the table:
#let td2 = td\\n#td2.data.insert(\\"__index\\", (1, 2, 2))\\n#to-tablex(\\n subset(td2, indexes: 2, fields: (\\"__index\\", \\"name\\"))\\n)\\n
\\nRows can also be selected by whether they fulfill a field condition:
\\n#to-tablex(\\n tada.filter(td, expression: \\"price < 1.5\\")\\n)\\n
\\nConcatenating rows and columns are both supported operations, but only\\nin the simple sense of stacking the data. Currently, there is no ability\\nto join on a field or otherwise intelligently merge data.
\\naxis: 0
places new rows below current rows
axis: 1
places new columns to the right of current columns
Unless you specify a fill value for missing values, the function\\nwill panic if the tables do not match exactly along their\\nconcatenation axis.
\\nYou cannot stack with axis: 1
unless every column has a unique\\nfield name.
#import tada: stack\\n\\n#let td2 = TableData(\\n data: (\\n name: (\\"Cheese\\", \\"Butter\\"),\\n price: (2.50, 1.75),\\n )\\n)\\n#let td3 = TableData(\\n data: (\\n rating: (4.5, 3.5, 5.0, 4.0, 2.5),\\n )\\n)\\n\\n// This would fail without specifying the fill\\n// since `quantity` is missing from `td2`\\n#let stack-a = stack(td, td2, missing-fill: 0)\\n#let stack-b = stack(stack-a, td3, axis: 1)\\n#to-tablex(stack-b)\\n
\\nThe easiest way to leverage TaDa\'s flexibility is through expressions.\\nThey can be strings that treat field names as variables, or functions\\nthat take keyword-only arguments.
\\n..rest
(the name is unimportant) to avoid errors.#let make-dict(field, expression) = {\\n let out = (:)\\n out.insert(\\n field,\\n (expression: expression, type: \\"currency\\"),\\n )\\n out\\n}\\n\\n#let td = update-fields(\\n td, ..make-dict(\\"total\\", \\"price * quantity\\" )\\n)\\n\\n#let tax-expr(total: none, ..rest) = { total * 0.2 }\\n#let taxed = update-fields(\\n td, ..make-dict(\\"tax\\", tax-expr),\\n)\\n\\n#to-tablex(\\n subset(taxed, fields: (\\"name\\", \\"total\\", \\"tax\\"))\\n)\\n
\\nIt is inconvenient to require several temporary variables as above, or\\ndeep function nesting, to perform multiple operations on a table. TaDa\\nprovides a chain
function to make this easier. Furthermore, when you\\nneed to compute several fields at once and don\'t need extra field\\ninformation, you can use add-expressions
as a shorthand:
#import tada: chain, add-expressions\\n#let totals = chain(td,\\n add-expressions.with(\\n total: \\"price * quantity\\",\\n tax: \\"total * 0.2\\",\\n after-tax: \\"total + tax\\",\\n ),\\n subset.with(\\n fields: (\\"name\\", \\"total\\", \\"after-tax\\")\\n ),\\n // Add type information\\n update-fields.with(\\n after-tax: (type: \\"currency\\", title: fmt(\\"w/ Tax\\")),\\n ),\\n)\\n#to-tablex(totals)\\n
\\nYou can sort by ascending/descending values of any field, or provide\\nyour own transformation function to the key
argument to customize\\nbehavior further:
#import tada: sort-values\\n#to-tablex(sort-values(\\n td, by: \\"quantity\\", descending: true\\n))\\n
\\nColumn-wise reduction is supported through agg
, using either functions\\nor string expressions:
#import tada: agg, item\\n#let grand-total = chain(\\n totals,\\n agg.with(after-tax: array.sum),\\n // use \\"item\\" to extract exactly one element\\n item\\n)\\n// \\"Output\\" is a helper function just for these docs.\\n// It is not necessary in your code.\\n#output[\\n *Grand total: #tada.display.format-usd(grand-total)*\\n]\\n
\\nIt is also easy to aggregate several expressions at once:
\\n#let agg-exprs = (\\n \\"# items\\": \\"quantity.sum()\\",\\n \\"Longest name\\": \\"[#name.sorted(key: str.len).at(-1)]\\",\\n)\\n#let agg-td = tada.agg(td, ..agg-exprs)\\n#to-tablex(agg-td)\\n
\\nTheorem environments in Typst with minimal fuss.
\\nTo use, import and add a show rule:
\\n#import \\"@preview/minienvs:0.1.0\\": *\\n#show: minienvs\\n
\\nYou can optionally pass a custom configuration in the show-rule via minienvs.with(…)
(see Customization).
You can now just add a theorem along with its proof using the term list syntax. For example:
\\n/ Theorem (Ville\'s inequality):\\n Let $X_0, ...$ be a non-negative supermartingale. Then, for any real number $a > 0$,\\n\\n $ PP[sup_(n>=0) X_n >= a] <= EE[X_0]/a. $\\n\\nLet us now prove it:\\n\\n/ Proof:\\n Consider the stopping time $N = inf {t >= 1 : X_t >= a}$.\\n By the optional stopping theorem and the supermartingale convergence theorem, we have that\\n\\n $\\n EE[X_0] >= EE[X_N]\\n &= EE[X_N | N < oo] PP[N < oo] + EE[X_oo | N = oo] PP[N = oo] \\\\\\n &>= EE[X_N | N < oo] PP[N < oo]\\n = EE[X_N/a | N < oo] a PP[N < oo]. \\\\\\n $\\n\\n And, therefore,\\n\\n $ PP[N < oo] <= EE[X_0] \\\\/ a EE[X_N/a | N < oo] <= EE[X_0] \\\\/ a. $\\n
\\nCurrently, in order to label a minienv one needs to use the envlabel
function. For example:
/ Lemma (Donsker and Varadhan\'s variational formula) #envlabel(<change-of-measure>):\\n For any measureable, bounded function $h : Theta -> RR$ we have:\\n\\n $ log EE_(theta ~ pi)[exp h(theta)] = sup_(rho in cal(P)(Theta)) [ EE_(theta~rho)[h(theta)] - KL(rho || pi) ]. $\\n\\nAs we will see, @change-of-measure is a fundamental building block of PAC-Bayes bounds.\\n
\\nYou can customize the appearance of minienvs by providing a configuration to the show-rule. For example, for the default configuration, you can do:
\\n#show: minienvs.with(config: (\\n // Whether to give numbers for environments.\\n // If the environment is not mentioned in this dict, it has a number.\\n no-numbering: (\\n proof: true,\\n ),\\n // Additional options for the `block` containing the minienv (e.g., to put a box around the minienv).\\n // If the environment is not mentioned in this dict, no additional options are passed.\\n bbox: (:),\\n // How to format the head of the minienv.\\n // If the environment is not mentioned in this dict, then it is formatted in bold.\\n head-style: (\\n proof: it => [_#{it}_],\\n ),\\n // How to format the body of the minienv.\\n // If the environment is not mentioned in this dict, then it is formatted in italic.\\n transforms: (\\n proof: it => [#it #h(1fr) $space qed$],\\n )\\n))\\n
\\nThe socialhub-fa
package is designed to help you create your curriculum vitae (CV). It allows you to easily reference your social media profiles with the typical icon of the service plus a link to your profile.
text
)otfs
folder within the unzipped foldermkdir -p /usr/share/fonts/truetype/
install -m644 \'Font Awesome 6 Brands-Regular-400.otf\' /usr/share/fonts/truetype/
install -m644 \'Font Awesome 6 Free-Regular-400.otf\' /usr/share/fonts/truetype/
You can install the library using the typst packages:
\\n#import \\"@preview/socialhub-fa:1.0.0\\": *\\n
\\nPut the socialhub-fa.typ
file in your project directory and import it:
#import \\"socialhub-fa.typ\\": *\\n
\\n// #import \\"@preview/socialhub-fa:1.0.0\\": github-info, gitlab-info\\n#import \\"socialhub-fa.typ\\": github-info, gitlab-info\\n\\nThis project was created by #github-info(\\"Bi0T1N\\"). You can also find me on #gitlab-info(\\"GitLab\\", rgb(\\"#811052\\"), url: \\"https://gitlab.com/Bi0T1N\\").\\n
\\nSee the examples.typ
file for a complete example. The generated PDF files are also available for preview.
Make sure that you have installed the required Font Awesome ligature-based font files.
\\nFeel free to open an issue or a pull request if you find any problems or have any suggestions.
\\nThis library is licensed under the MIT license. Feel free to use it in your project.
\\n","description":"The socialhub-fa package is designed to help you create your curriculum vitae (CV). It allows you to easily reference your social media profiles with the typical icon of the service plus a link to your profile. Features\\nSupport for popular social media, developer and career…","guid":"https://typst.app/universe/package/socialhub-fa","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-12-03T10:58:24.745Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"wavy (0.1.1) | Draw digital timing diagram in Typst using Wavedrom.","url":"https://typst.app/universe/package/wavy","content":"Draw digital timing diagram in Typst using Wavedrom.
\\n#import \\"@preview/wavy:0.1.1\\"\\n\\n#set page(height: auto, width: auto, fill: black, margin: 2em)\\n#set text(fill: white)\\n\\n#show raw.where(lang: \\"wavy\\"): it => wavy.render(it.text)\\n\\n= Wavy\\n\\nTypst, now with waves.\\n\\n```wavy\\n{\\n signal:\\n [\\n {name:\'clk\',wave:\'p......\'},\\n {name:\'bus\',wave:\'x.34.5x\',data:\'head body tail\'},\\n {name:\'wire\',wave:\'0.1..0.\'}\\n ]\\n}\\n```\\n\\n```js\\n{\\n signal:\\n [\\n {name:\'clk\',wave:\'p......\'},\\n {name:\'bus\',wave:\'x.34.5x\',data:\'head body tail\'},\\n {name:\'wire\',wave:\'0.1..0.\'}\\n ]\\n}\\n```\\n\\n
\\nrender
Render a wavedrom json5 string to an image
\\nsrc
: str
- wavedrom json5 stringimage.decode
so you can customize the image sizeThe image, of type content
#import \\"@preview/rubby:0.10.1\\": get-ruby\\n\\n#let ruby = get-ruby(\\n size: 0.5em, // Ruby font size\\n dy: 0pt, // Vertical offset of the ruby\\n pos: top, // Ruby position (top or bottom)\\n alignment: \\"center\\", // Ruby alignment (\\"center\\", \\"start\\", \\"between\\", \\"around\\")\\n delimiter: \\"|\\", // The delimiter between words\\n auto-spacing: true, // Automatically add necessary space around words\\n)\\n\\n// Ruby goes first, base text - second.\\n#ruby[ふりがな][振り仮名]\\n\\nTreat each kanji as a separate word:\\n#ruby[とう|きょう|こう|ぎょう|だい|がく][東|京|工|業|大|学]\\n
\\nIf you don\'t want automatically wrap text with delimiter:
\\n#let ruby = get-ruby(auto-spacing: false)\\n
\\nSee also https://github.com/rinmyo/ruby-typ/blob/main/manual.pdf and example.typ
.
Original project is at https://github.com/rinmyo/ruby-typ which itself is\\nbased on the post\\nof 齊藤敦志 (Saito Atsushi). This project is a modified version of\\nthis commit.
\\nauto-spacing
adds missing delimiter around the content
/string
which\\nthen adds space around base text if ruby is wider than the base text.
Problems appear only if ruby is wider than its base text and auto-spacing
is\\nnot set to true
(default is true
).
You can always use a one-letter function (variable) name to shorten the\\nfunction call length (if you have to use it a lot), e.g., #let r = get-ruby()
\\n(or f
— short for furigana). But be careful as there are functions with names\\nv
and h
and there could be a new built-in function with a name r
or f
\\nwhich may break your document (Typst right now is in beta, so breaking changes\\nare possible).
Although you can open issues or send PRs, I won\'t be able to always reply\\nquickly (sometimes I\'m very busy).
\\nThis repository should exist as a @local
package with the version from the typst.toml
.
Here is a short description of the development process:
\\ngit checkout dev && git pull
;just change-version <new semantic version>
;CHANGELOG.md
;@local
Typst package with the new version and test it;git push
;git checkout master && git merge dev
to sync master
to dev
;just create-release
.typst/packages
repository run\\njust mark-PR-version
;typst/packages
repository;git fetch upstream && git merge upstream main
to sync fork with typst/packages
;git checkout -b <package-version>
;package:version
;gh pr create
and follow further CLI instructions.You can view the change log in the CHANGELOG.md
file in the root of the project.
This Typst package is licensed under AGPL v3.0. You can view the license in the\\nLICENSE file in the root of the project or at\\nhttps://www.gnu.org/licenses/agpl-3.0.txt. There is also a NOTICE file for\\n3rd party copyright notices.
\\nCopyright (C) 2023 Andrew Voynov
\\n","description":"Usage #import \\"@preview/rubby:0.10.1\\": get-ruby\\n\\n#let ruby = get-ruby(\\n size: 0.5em, // Ruby font size\\n dy: 0pt, // Vertical offset of the ruby\\n pos: top, // Ruby position (top or bottom)\\n alignment: \\"center\\", // Ruby alignment (\\"center…","guid":"https://typst.app/universe/package/rubby","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-12-03T10:49:13.137Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"anti-matter (0.1.1) | Simple page numbering of front and back matter.","url":"https://typst.app/universe/package/anti-matter","content":"This typst packages allows you to simply mark the end and start of your front matter and back matter\\nto change style and value of your page number without manually setting and keeping track of inner\\nand outer page counters.
\\n#import \\"@preview/anti-matter:0.1.1\\": anti-matter, fence, set-numbering\\n\\n#set page(\\"a4\\", height: auto)\\n#show heading.where(level: 1): it => pagebreak(weak: true) + it\\n\\n#show: anti-matter\\n\\n#set-numbering(none)\\n#align(center)[My Title Page]\\n#pagebreak()\\n#set-numbering(\\"I\\")\\n\\n#include \\"front-matter.typ\\"\\n#fence()\\n\\n#include \\"chapters.typ\\"\\n#fence()\\n\\n#include \\"back-matter.typ\\"\\n
\\nstep
, see section II in the manual.outline.entry
, you must use page-number
, see section II in the\\nmanual.pagebreak
\\nforcing them on the next page it will also incorrectly label that page.The package name anti-matter
was choosen as a word play on front/back matter.
\\n\\nA compilation of esoteric languages including for now brainfuck
\\n
#import \\"@preview/esotefy:1.0.0\\": brainf;\\n\\n#brainf(\\"++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.\\");\\n
\\nInto
\\n#import \\"@preview/esotefy:1.0.0\\": brainf;\\n\\n#brainf(\\"++++++++++++++[->,.<]\\", inp: \\"Goodbye World!\\");\\n
\\nInto
\\nI\'ve based my implementation from theses documents:
\\nDraw QR codes in typst.
\\n#import \\"@preview/cades:0.3.0\\": qr-code\\n\\n= QR Code for `typst.app`:\\n#qr-code(\\"https://typst.app\\", width: 3cm)\\n\\n
\\nqr-code
Draw a qr code to an image.
\\ncontent
: str
- the content of the qr codewidth
: length
|auto
- the width of the qr code, default is auto
height
: length
|auto
- the height of the qr code, default is auto
color
: color
- the color of the qrcode, default is black
background
: color
- the background color behind the qrcode, default is white
error-correction
: \\"L\\"
|\\"M\\"
|\\"Q\\"
|\\"H\\"
- the error correction level for the qr code, default is \\"M\\"
The image, of type content
.
This package uses Jogs by Wenzhuo Liu and the qr code rendering code is based on qrcode-svg by papnkukn.
\\n","description":"Draw QR codes in typst. #import \\"@preview/cades:0.3.0\\": qr-code\\n\\n= QR Code for `typst.app`:\\n#qr-code(\\"https://typst.app\\", width: 3cm)\\n\\n\\nDocumentation\\nqr-code\\n\\nDraw a qr code to an image.\\n\\nArguments\\ncontent: str - the content of the qr code\\nwidth: length|auto - the width of the qr…","guid":"https://typst.app/universe/package/cades","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-11-25T11:10:03.509Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"cartao (0.1.0) | Dead simple flashcards with Typst.","url":"https://typst.app/universe/package/cartao","content":"Dead simple flashcards with Typst.
\\n#import \\"@preview/cartao:0.1.0\\": card, letter8up, a48up\\n\\n#set page(\\n paper: \\"a4\\",\\n // paper: \\"us-letter\\",\\n // paper: \\"presentation-16-9\\",\\n margin: (x: 0cm, y: 0cm),\\n)\\n\\n// build the cards\\n#a48up\\n// #letter8up\\n// #present\\n\\n// define your cards\\n#card(\\n [Header],\\n [Footer],\\n [Question?],\\n [answer]\\n)\\n\\n#card(\\n [portuguese],\\n [Hint: Its the title of this package!],\\n [card],\\n [cartão]\\n)\\n\\n#card(\\n [french],\\n [Hint: close to the portuguese],\\n [card],\\n [carte]\\n)\\n
\\ncard
Defines a card by updating the below counter
and state
(s), and dropping a label.
#let card(header, footer, question, answer) = [\\n #cardnumber.step()\\n #cardheader.update(header)\\n #cardfooter.update(footer)\\n #cardquestion.update(question)\\n #cardanswer.update(answer)\\n <card>\\n]\\n
\\nheader
footer
question
answer
How they work
\\n<card>
labelcardnumber
counter, and cardheader
, cardfooter
, cardquestion
, cardanswer
states at each <card>
.#a48up
and #letter8up
functions describe the layout of each card for each item in these arrays, and also rearrange the answers so that the layout makes sense when printed double sided.content
onto the page.\\n#a48up
and letter8up
, each item is dumped into a 2-column table.cartao
comes builtin with the following card building functions. Take a look at the source for how they work, and use them as a guide to help you build your own flashcards with different sizes/formats.
a48up
Produces a 2x8 portrait card layout on a4 paper.
\\nDesigned to be printed double-sided on the perforated 8-up a4 card paper you can find on Amazon
\\n#a48up\\n
\\nletter8up
Produces a 2x8 portrait card layout on us-letter paper.
\\n#letter8up\\n
\\npresent
A 16:9 presentation of the flashcards with questions and answers on different slides
\\n#present\\n
\\n","description":"Dead simple flashcards with Typst. Example usage:\\n#import \\"@preview/cartao:0.1.0\\": card, letter8up, a48up\\n\\n#set page(\\n paper: \\"a4\\",\\n // paper: \\"us-letter\\",\\n // paper: \\"presentation-16-9\\",\\n margin: (x: 0cm, y: 0cm),\\n)\\n\\n// build the cards\\n#a48up\\n// #letter8up\\n// #present…","guid":"https://typst.app/universe/package/cartao","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-11-21T09:21:52.253Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"tablem (0.1.0) | Write markdown-like tables easily.","url":"https://typst.app/universe/package/tablem","content":"Write markdown-like tables easily.
\\nHave a look at the source here.
\\nYou can simply copy the markdown table and paste it in tablem
function.
#import \\"@preview/tablem:0.1.0\\": tablem\\n\\n#tablem[\\n | *Name* | *Location* | *Height* | *Score* |\\n | ------ | ---------- | -------- | ------- |\\n | John | Second St. | 180 cm | 5 |\\n | Wally | Third Av. | 160 cm | 10 |\\n]\\n
\\nAnd you can use custom render function.
\\n#import \\"@preview/tablex:0.0.6\\": tablex, hlinex\\n#import \\"@preview/tablem:0.1.0\\": tablem\\n\\n#let three-line-table = tablem.with(\\n render: (columns: auto, ..args) => {\\n tablex(\\n columns: columns,\\n auto-lines: false,\\n align: center + horizon,\\n hlinex(y: 0),\\n hlinex(y: 1),\\n ..args,\\n hlinex(),\\n )\\n }\\n)\\n\\n#three-line-table[\\n | *Name* | *Location* | *Height* | *Score* |\\n | ------ | ---------- | -------- | ------- |\\n | John | Second St. | 180 cm | 5 |\\n | Wally | Third Av. | 160 cm | 10 |\\n]\\n
\\ntablem
function#let tablem(\\n render: table,\\n ignore-second-row: true,\\n ..args,\\n body\\n) = { .. }\\n
\\nArguments:
\\nrender
: [(columns: int, ..args) => { .. }
] — Custom render function, default to be table
, receiving a integer-type columns, which is the count of first row. ..args
is the combination of args
of tablem
function and children genenerated from body
.ignore-second-row
: [boolean
] — Whether to ignore the second row (something like |---|
).args
: [any
] — Some arguments you want to pass to render
function.body
: [content
] — The markdown-like table. There should be no extra line breaks in it.Cell merging has not yet been implemented.
\\nThis project is licensed under the MIT License.
\\n","description":"Write markdown-like tables easily. Example\\n\\nHave a look at the source here.\\n\\nUsage\\n\\nYou can simply copy the markdown table and paste it in tablem function.\\n\\n#import \\"@preview/tablem:0.1.0\\": tablem\\n\\n#tablem[\\n | *Name* | *Location* | *Height* | *Score* |\\n | ------ | ---------- | --…","guid":"https://typst.app/universe/package/tablem","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-11-18T13:49:38.892Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/tablem/0.1.0/examples/example.png","type":"photo","width":1154,"height":780},{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/tablem/0.1.0/examples/example.png","type":"photo","width":1154,"height":780}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"octique (0.1.0) | GitHub Octicons for Typst.","url":"https://typst.app/universe/package/octique","content":"GitHub Octicons for Typst.
\\n#import \\"@preview/octique:0.1.0\\": *\\n
\\n// Returns an image for the given name.\\noctique(name, color: rgb(\\"#000000\\"), width: 1em, height: 1em)\\n\\n// Returns a boxed image for the given name.\\noctique-inline(name, color: rgb(\\"#000000\\"), width: 1em, height: 1em, baseline: 25%)\\n\\n// Returns an SVG text for the given name.\\noctique-svg(name)\\n
\\nSee also sample/sample.pdf
.
| Code | Icon |\\n| ---- | :--: |\\n|#octique(\\"accessibility-inset\\")
| |\\n|
#octique(\\"accessibility\\")
| |\\n|
#octique(\\"alert-fill\\")
| |\\n|
#octique(\\"alert\\")
| |\\n|
#octique(\\"apps\\")
| |\\n|
#octique(\\"archive\\")
| |\\n|
#octique(\\"arrow-both\\")
| |\\n|
#octique(\\"arrow-down-left\\")
| |\\n|
#octique(\\"arrow-down-right\\")
| |\\n|
#octique(\\"arrow-down\\")
| |\\n|
#octique(\\"arrow-left\\")
| |\\n|
#octique(\\"arrow-right\\")
| |\\n|
#octique(\\"arrow-switch\\")
| |\\n|
#octique(\\"arrow-up-left\\")
| |\\n|
#octique(\\"arrow-up-right\\")
| |\\n|
#octique(\\"arrow-up\\")
| |\\n|
#octique(\\"beaker\\")
| |\\n|
#octique(\\"bell-fill\\")
| |\\n|
#octique(\\"bell-slash\\")
| |\\n|
#octique(\\"bell\\")
| |\\n|
#octique(\\"blocked\\")
| |\\n|
#octique(\\"bold\\")
| |\\n|
#octique(\\"book\\")
| |\\n|
#octique(\\"bookmark-slash\\")
| |\\n|
#octique(\\"bookmark\\")
| |\\n|
#octique(\\"briefcase\\")
| |\\n|
#octique(\\"broadcast\\")
| |\\n|
#octique(\\"browser\\")
| |\\n|
#octique(\\"bug\\")
| |\\n|
#octique(\\"cache\\")
| |\\n|
#octique(\\"calendar\\")
| |\\n|
#octique(\\"check-circle-fill\\")
| |\\n|
#octique(\\"check-circle\\")
| |\\n|
#octique(\\"check\\")
| |\\n|
#octique(\\"checkbox\\")
| |\\n|
#octique(\\"checklist\\")
| |\\n|
#octique(\\"chevron-down\\")
| |\\n|
#octique(\\"chevron-left\\")
| |\\n|
#octique(\\"chevron-right\\")
| |\\n|
#octique(\\"chevron-up\\")
| |\\n|
#octique(\\"circle-slash\\")
| |\\n|
#octique(\\"circle\\")
| |\\n|
#octique(\\"clock-fill\\")
| |\\n|
#octique(\\"clock\\")
| |\\n|
#octique(\\"cloud-offline\\")
| |\\n|
#octique(\\"cloud\\")
| |\\n|
#octique(\\"code-of-conduct\\")
| |\\n|
#octique(\\"code-review\\")
| |\\n|
#octique(\\"code\\")
| |\\n|
#octique(\\"code-square\\")
| |\\n|
#octique(\\"codescan-checkmark\\")
| |\\n|
#octique(\\"codescan\\")
| |\\n|
#octique(\\"codespaces\\")
| |\\n|
#octique(\\"columns\\")
| |\\n|
#octique(\\"command-palette\\")
| |\\n|
#octique(\\"comment-discussion\\")
| |\\n|
#octique(\\"comment\\")
| |\\n|
#octique(\\"container\\")
| |\\n|
#octique(\\"copilot-error\\")
| |\\n|
#octique(\\"copilot\\")
| |\\n|
#octique(\\"copilot-warning\\")
| |\\n|
#octique(\\"copy\\")
| |\\n|
#octique(\\"cpu\\")
| |\\n|
#octique(\\"credit-card\\")
| |\\n|
#octique(\\"cross-reference\\")
| |\\n|
#octique(\\"dash\\")
| |\\n|
#octique(\\"database\\")
| |\\n|
#octique(\\"dependabot\\")
| |\\n|
#octique(\\"desktop-download\\")
| |\\n|
#octique(\\"device-camera\\")
| |\\n|
#octique(\\"device-camera-video\\")
| |\\n|
#octique(\\"device-desktop\\")
| |\\n|
#octique(\\"device-mobile\\")
| |\\n|
#octique(\\"devices\\")
| |\\n|
#octique(\\"diamond\\")
| |\\n|
#octique(\\"diff-added\\")
| |\\n|
#octique(\\"diff-ignored\\")
| |\\n|
#octique(\\"diff-modified\\")
| |\\n|
#octique(\\"diff-removed\\")
| |\\n|
#octique(\\"diff-renamed\\")
| |\\n|
#octique(\\"diff\\")
| |\\n|
#octique(\\"discussion-closed\\")
| |\\n|
#octique(\\"discussion-duplicate\\")
| |\\n|
#octique(\\"discussion-outdated\\")
| |\\n|
#octique(\\"dot-fill\\")
| |\\n|
#octique(\\"dot\\")
| |\\n|
#octique(\\"download\\")
| |\\n|
#octique(\\"duplicate\\")
| |\\n|
#octique(\\"ellipsis\\")
| |\\n|
#octique(\\"eye-closed\\")
| |\\n|
#octique(\\"eye\\")
| |\\n|
#octique(\\"feed-discussion\\")
| |\\n|
#octique(\\"feed-forked\\")
| |\\n|
#octique(\\"feed-heart\\")
| |\\n|
#octique(\\"feed-issue-closed\\")
| |\\n|
#octique(\\"feed-issue-draft\\")
| |\\n|
#octique(\\"feed-issue-open\\")
| |\\n|
#octique(\\"feed-issue-reopen\\")
| |\\n|
#octique(\\"feed-merged\\")
| |\\n|
#octique(\\"feed-person\\")
| |\\n|
#octique(\\"feed-plus\\")
| |\\n|
#octique(\\"feed-public\\")
| |\\n|
#octique(\\"feed-pull-request-closed\\")
| |\\n|
#octique(\\"feed-pull-request-draft\\")
| |\\n|
#octique(\\"feed-pull-request-open\\")
| |\\n|
#octique(\\"feed-repo\\")
| |\\n|
#octique(\\"feed-rocket\\")
| |\\n|
#octique(\\"feed-star\\")
| |\\n|
#octique(\\"feed-tag\\")
| |\\n|
#octique(\\"feed-trophy\\")
| |\\n|
#octique(\\"file-added\\")
| |\\n|
#octique(\\"file-badge\\")
| |\\n|
#octique(\\"file-binary\\")
| |\\n|
#octique(\\"file-code\\")
| |\\n|
#octique(\\"file-diff\\")
| |\\n|
#octique(\\"file-directory-fill\\")
| |\\n|
#octique(\\"file-directory-open-fill\\")
| |\\n|
#octique(\\"file-directory\\")
| |\\n|
#octique(\\"file-directory-symlink\\")
| |\\n|
#octique(\\"file-moved\\")
| |\\n|
#octique(\\"file-removed\\")
| |\\n|
#octique(\\"file\\")
| |\\n|
#octique(\\"file-submodule\\")
| |\\n|
#octique(\\"file-symlink-file\\")
| |\\n|
#octique(\\"file-zip\\")
| |\\n|
#octique(\\"filter\\")
| |\\n|
#octique(\\"fiscal-host\\")
| |\\n|
#octique(\\"flame\\")
| |\\n|
#octique(\\"fold-down\\")
| |\\n|
#octique(\\"fold\\")
| |\\n|
#octique(\\"fold-up\\")
| |\\n|
#octique(\\"gear\\")
| |\\n|
#octique(\\"gift\\")
| |\\n|
#octique(\\"git-branch\\")
| |\\n|
#octique(\\"git-commit\\")
| |\\n|
#octique(\\"git-compare\\")
| |\\n|
#octique(\\"git-merge-queue\\")
| |\\n|
#octique(\\"git-merge\\")
| |\\n|
#octique(\\"git-pull-request-closed\\")
| |\\n|
#octique(\\"git-pull-request-draft\\")
| |\\n|
#octique(\\"git-pull-request\\")
| |\\n|
#octique(\\"globe\\")
| |\\n|
#octique(\\"goal\\")
| |\\n|
#octique(\\"grabber\\")
| |\\n|
#octique(\\"graph\\")
| |\\n|
#octique(\\"hash\\")
| |\\n|
#octique(\\"heading\\")
| |\\n|
#octique(\\"heart-fill\\")
| |\\n|
#octique(\\"heart\\")
| |\\n|
#octique(\\"history\\")
| |\\n|
#octique(\\"home\\")
| |\\n|
#octique(\\"horizontal-rule\\")
| |\\n|
#octique(\\"hourglass\\")
| |\\n|
#octique(\\"hubot\\")
| |\\n|
#octique(\\"id-badge\\")
| |\\n|
#octique(\\"image\\")
| |\\n|
#octique(\\"inbox\\")
| |\\n|
#octique(\\"infinity\\")
| |\\n|
#octique(\\"info\\")
| |\\n|
#octique(\\"issue-closed\\")
| |\\n|
#octique(\\"issue-draft\\")
| |\\n|
#octique(\\"issue-opened\\")
| |\\n|
#octique(\\"issue-reopened\\")
| |\\n|
#octique(\\"issue-tracked-by\\")
| |\\n|
#octique(\\"issue-tracks\\")
| |\\n|
#octique(\\"italic\\")
| |\\n|
#octique(\\"iterations\\")
| |\\n|
#octique(\\"kebab-horizontal\\")
| |\\n|
#octique(\\"key-asterisk\\")
| |\\n|
#octique(\\"key\\")
| |\\n|
#octique(\\"law\\")
| |\\n|
#octique(\\"light-bulb\\")
| |\\n|
#octique(\\"link-external\\")
| |\\n|
#octique(\\"link\\")
| |\\n|
#octique(\\"list-ordered\\")
| |\\n|
#octique(\\"list-unordered\\")
| |\\n|
#octique(\\"location\\")
| |\\n|
#octique(\\"lock\\")
| |\\n|
#octique(\\"log\\")
| |\\n|
#octique(\\"logo-gist\\")
| |\\n|
#octique(\\"logo-github\\")
| |\\n|
#octique(\\"mail\\")
| |\\n|
#octique(\\"mark-github\\")
| |\\n|
#octique(\\"markdown\\")
| |\\n|
#octique(\\"megaphone\\")
| |\\n|
#octique(\\"mention\\")
| |\\n|
#octique(\\"meter\\")
| |\\n|
#octique(\\"milestone\\")
| |\\n|
#octique(\\"mirror\\")
| |\\n|
#octique(\\"moon\\")
| |\\n|
#octique(\\"mortar-board\\")
| |\\n|
#octique(\\"move-to-bottom\\")
| |\\n|
#octique(\\"move-to-end\\")
| |\\n|
#octique(\\"move-to-start\\")
| |\\n|
#octique(\\"move-to-top\\")
| |\\n|
#octique(\\"multi-select\\")
| |\\n|
#octique(\\"mute\\")
| |\\n|
#octique(\\"no-entry\\")
| |\\n|
#octique(\\"north-star\\")
| |\\n|
#octique(\\"note\\")
| |\\n|
#octique(\\"number\\")
| |\\n|
#octique(\\"organization\\")
| |\\n|
#octique(\\"package-dependencies\\")
| |\\n|
#octique(\\"package-dependents\\")
| |\\n|
#octique(\\"package\\")
| |\\n|
#octique(\\"paintbrush\\")
| |\\n|
#octique(\\"paper-airplane\\")
| |\\n|
#octique(\\"paperclip\\")
| |\\n|
#octique(\\"passkey-fill\\")
| |\\n|
#octique(\\"paste\\")
| |\\n|
#octique(\\"pencil\\")
| |\\n|
#octique(\\"people\\")
| |\\n|
#octique(\\"person-add\\")
| |\\n|
#octique(\\"person-fill\\")
| |\\n|
#octique(\\"person\\")
| |\\n|
#octique(\\"pin-slash\\")
| |\\n|
#octique(\\"pin\\")
| |\\n|
#octique(\\"pivot-column\\")
| |\\n|
#octique(\\"play\\")
| |\\n|
#octique(\\"plug\\")
| |\\n|
#octique(\\"plus-circle\\")
| |\\n|
#octique(\\"plus\\")
| |\\n|
#octique(\\"project-roadmap\\")
| |\\n|
#octique(\\"project\\")
| |\\n|
#octique(\\"project-symlink\\")
| |\\n|
#octique(\\"project-template\\")
| |\\n|
#octique(\\"pulse\\")
| |\\n|
#octique(\\"question\\")
| |\\n|
#octique(\\"quote\\")
| |\\n|
#octique(\\"read\\")
| |\\n|
#octique(\\"redo\\")
| |\\n|
#octique(\\"rel-file-path\\")
| |\\n|
#octique(\\"reply\\")
| |\\n|
#octique(\\"repo-clone\\")
| |\\n|
#octique(\\"repo-deleted\\")
| |\\n|
#octique(\\"repo-forked\\")
| |\\n|
#octique(\\"repo-locked\\")
| |\\n|
#octique(\\"repo-pull\\")
| |\\n|
#octique(\\"repo-push\\")
| |\\n|
#octique(\\"repo\\")
| |\\n|
#octique(\\"repo-template\\")
| |\\n|
#octique(\\"report\\")
| |\\n|
#octique(\\"rocket\\")
| |\\n|
#octique(\\"rows\\")
| |\\n|
#octique(\\"rss\\")
| |\\n|
#octique(\\"ruby\\")
| |\\n|
#octique(\\"screen-full\\")
| |\\n|
#octique(\\"screen-normal\\")
| |\\n|
#octique(\\"search\\")
| |\\n|
#octique(\\"server\\")
| |\\n|
#octique(\\"share-android\\")
| |\\n|
#octique(\\"share\\")
| |\\n|
#octique(\\"shield-check\\")
| |\\n|
#octique(\\"shield-lock\\")
| |\\n|
#octique(\\"shield-slash\\")
| |\\n|
#octique(\\"shield\\")
| |\\n|
#octique(\\"shield-x\\")
| |\\n|
#octique(\\"sidebar-collapse\\")
| |\\n|
#octique(\\"sidebar-expand\\")
| |\\n|
#octique(\\"sign-in\\")
| |\\n|
#octique(\\"sign-out\\")
| |\\n|
#octique(\\"single-select\\")
| |\\n|
#octique(\\"skip-fill\\")
| |\\n|
#octique(\\"skip\\")
| |\\n|
#octique(\\"sliders\\")
| |\\n|
#octique(\\"smiley\\")
| |\\n|
#octique(\\"sort-asc\\")
| |\\n|
#octique(\\"sort-desc\\")
| |\\n|
#octique(\\"sparkle-fill\\")
| |\\n|
#octique(\\"sponsor-tiers\\")
| |\\n|
#octique(\\"square-fill\\")
| |\\n|
#octique(\\"square\\")
| |\\n|
#octique(\\"squirrel\\")
| |\\n|
#octique(\\"stack\\")
| |\\n|
#octique(\\"star-fill\\")
| |\\n|
#octique(\\"star\\")
| |\\n|
#octique(\\"stop\\")
| |\\n|
#octique(\\"stopwatch\\")
| |\\n|
#octique(\\"strikethrough\\")
| |\\n|
#octique(\\"sun\\")
| |\\n|
#octique(\\"sync\\")
| |\\n|
#octique(\\"tab-external\\")
| |\\n|
#octique(\\"table\\")
| |\\n|
#octique(\\"tag\\")
| |\\n|
#octique(\\"tasklist\\")
| |\\n|
#octique(\\"telescope-fill\\")
| |\\n|
#octique(\\"telescope\\")
| |\\n|
#octique(\\"terminal\\")
| |\\n|
#octique(\\"three-bars\\")
| |\\n|
#octique(\\"thumbsdown\\")
| |\\n|
#octique(\\"thumbsup\\")
| |\\n|
#octique(\\"tools\\")
| |\\n|
#octique(\\"tracked-by-closed-completed\\")
| |\\n|
#octique(\\"tracked-by-closed-not-planned\\")
| |\\n|
#octique(\\"trash\\")
| |\\n|
#octique(\\"triangle-down\\")
| |\\n|
#octique(\\"triangle-left\\")
| |\\n|
#octique(\\"triangle-right\\")
| |\\n|
#octique(\\"triangle-up\\")
| |\\n|
#octique(\\"trophy\\")
| |\\n|
#octique(\\"typography\\")
| |\\n|
#octique(\\"undo\\")
| |\\n|
#octique(\\"unfold\\")
| |\\n|
#octique(\\"unlink\\")
| |\\n|
#octique(\\"unlock\\")
| |\\n|
#octique(\\"unmute\\")
| |\\n|
#octique(\\"unread\\")
| |\\n|
#octique(\\"unverified\\")
| |\\n|
#octique(\\"upload\\")
| |\\n|
#octique(\\"verified\\")
| |\\n|
#octique(\\"versions\\")
| |\\n|
#octique(\\"video\\")
| |\\n|
#octique(\\"webhook\\")
| |\\n|
#octique(\\"workflow\\")
| |\\n|
#octique(\\"x-circle-fill\\")
| |\\n|
#octique(\\"x-circle\\")
| |\\n|
#octique(\\"x\\")
| |\\n|
#octique(\\"zap\\")
| |\\n|
#octique(\\"zoom-in\\")
| |\\n|
#octique(\\"zoom-out\\")
| |
MIT. See LICENSE for detail.
\\nOcticons are (c) GitHub, Inc. When using the GitHub logos, you should follow the GitHub logo guidelines.
\\n","description":"GitHub Octicons for Typst. Installation\\n#import \\"@preview/octique:0.1.0\\": *\\n\\nUsage\\n// Returns an image for the given name.\\noctique(name, color: rgb(\\"#000000\\"), width: 1em, height: 1em)\\n\\n// Returns a boxed image for the given name.\\noctique-inline(name, color: rgb(\\"#000000…","guid":"https://typst.app/universe/package/octique","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-11-18T13:49:11.806Z","media":[{"url":"https://github.com/0x6b/typst-octique/wiki/assets/accessibility-inset.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/accessibility.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/alert-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/alert.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/apps.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/archive.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-both.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-down-left.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-down-right.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-down.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-left.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-right.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-switch.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-up-left.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-up-right.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/arrow-up.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/beaker.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/bell-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/bell-slash.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/bell.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/blocked.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/bold.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/book.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/bookmark-slash.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/bookmark.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/briefcase.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/broadcast.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/browser.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/bug.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/cache.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/calendar.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/check-circle-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/check-circle.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/check.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/checkbox.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/checklist.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/chevron-down.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/chevron-left.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/chevron-right.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/chevron-up.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/circle-slash.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/circle.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/clock-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/clock.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/cloud-offline.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/cloud.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/code-of-conduct.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/code-review.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/code.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/code-square.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/codescan-checkmark.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/codescan.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/codespaces.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/columns.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/command-palette.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/comment-discussion.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/comment.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/container.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/copilot-error.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/copilot.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/copilot-warning.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/copy.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/cpu.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/credit-card.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/cross-reference.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/dash.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/database.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/dependabot.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/desktop-download.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/device-camera.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/device-camera-video.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/device-desktop.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/device-mobile.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/devices.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/diamond.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/diff-added.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/diff-ignored.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/diff-modified.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/diff-removed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/diff-renamed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/diff.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/discussion-closed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/discussion-duplicate.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/discussion-outdated.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/dot-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/dot.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/download.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/duplicate.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/ellipsis.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/eye-closed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/eye.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-discussion.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-forked.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-heart.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-issue-closed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-issue-draft.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-issue-open.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-issue-reopen.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-merged.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-person.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-plus.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-public.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-pull-request-closed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-pull-request-draft.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-pull-request-open.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-repo.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-rocket.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-star.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-tag.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/feed-trophy.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-added.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-badge.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-binary.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-code.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-diff.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-directory-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-directory-open-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-directory.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-directory-symlink.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-moved.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-removed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-submodule.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-symlink-file.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/file-zip.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/filter.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/fiscal-host.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/flame.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/fold-down.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/fold.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/fold-up.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/gear.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/gift.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/git-branch.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/git-commit.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/git-compare.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/git-merge-queue.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/git-merge.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/git-pull-request-closed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/git-pull-request-draft.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/git-pull-request.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/globe.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/goal.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/grabber.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/graph.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/hash.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/heading.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/heart-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/heart.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/history.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/home.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/horizontal-rule.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/hourglass.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/hubot.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/id-badge.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/image.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/inbox.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/infinity.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/info.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/issue-closed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/issue-draft.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/issue-opened.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/issue-reopened.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/issue-tracked-by.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/issue-tracks.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/italic.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/iterations.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/kebab-horizontal.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/key-asterisk.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/key.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/law.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/light-bulb.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/link-external.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/link.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/list-ordered.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/list-unordered.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/location.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/lock.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/log.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/logo-gist.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/logo-github.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/mail.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/mark-github.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/markdown.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/megaphone.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/mention.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/meter.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/milestone.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/mirror.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/moon.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/mortar-board.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/move-to-bottom.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/move-to-end.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/move-to-start.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/move-to-top.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/multi-select.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/mute.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/no-entry.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/north-star.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/note.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/number.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/organization.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/package-dependencies.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/package-dependents.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/package.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/paintbrush.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/paper-airplane.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/paperclip.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/passkey-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/paste.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/pencil.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/people.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/person-add.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/person-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/person.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/pin-slash.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/pin.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/pivot-column.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/play.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/plug.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/plus-circle.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/plus.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/project-roadmap.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/project.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/project-symlink.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/project-template.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/pulse.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/question.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/quote.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/read.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/redo.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/rel-file-path.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/reply.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/repo-clone.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/repo-deleted.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/repo-forked.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/repo-locked.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/repo-pull.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/repo-push.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/repo.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/repo-template.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/report.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/rocket.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/rows.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/rss.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/ruby.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/screen-full.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/screen-normal.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/search.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/server.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/share-android.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/share.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/shield-check.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/shield-lock.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/shield-slash.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/shield.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/shield-x.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sidebar-collapse.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sidebar-expand.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sign-in.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sign-out.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/single-select.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/skip-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/skip.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sliders.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/smiley.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sort-asc.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sort-desc.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sparkle-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sponsor-tiers.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/square-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/square.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/squirrel.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/stack.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/star-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/star.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/stop.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/stopwatch.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/strikethrough.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sun.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/sync.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/tab-external.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/table.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/tag.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/tasklist.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/telescope-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/telescope.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/terminal.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/three-bars.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/thumbsdown.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/thumbsup.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/tools.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/tracked-by-closed-completed.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/tracked-by-closed-not-planned.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/trash.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/triangle-down.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/triangle-left.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/triangle-right.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/triangle-up.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/trophy.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/typography.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/undo.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/unfold.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/unlink.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/unlock.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/unmute.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/unread.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/unverified.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/upload.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/verified.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/versions.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/video.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/webhook.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/workflow.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/x-circle-fill.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/x-circle.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/x.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/zap.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/zoom-in.svg","type":"photo","width":16,"height":16},{"url":"https://github.com/0x6b/typst-octique/wiki/assets/zoom-out.svg","type":"photo","width":16,"height":16}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"sourcerer (0.2.1) | Customizable and flexible source-code blocks","url":"https://typst.app/universe/package/sourcerer","content":"Sourcerer is a Typst package for displaying stylized source code blocks, with some extra features. Main features include:
\\nreference
)First, import the package via:
\\n#import \\"@preview/sourcerer:0.2.1\\": code\\n
\\nThen, display custom code blocks via the code
function, like so:
#code(\\n lang: \\"Typst\\",\\n ```typ\\n Woah, that\'s pretty #smallcaps(cool)!\\n That\'s neat too.\\n ```\\n)\\n
\\nThis results in:
\\n\\n \\n
To view all of the options of the code
function, consult the documentation.
You can use the colour palette with gradients for maximum results!\\nFor example the code in example/example.typ
which is
#import \\"@preview/stonewall:0.1.0\\": flags\\n\\n#set page(width: 200pt, height: auto, margin: 0pt)\\n#set text(fill: black, size: 12pt)\\n#set text(top-edge: \\"bounds\\", bottom-edge: \\"bounds\\")\\n\\n\\n#stack(\\n spacing: 3pt,\\n ..flags.map(((name, preset)) => block(\\n width: 100%,\\n height: 20pt,\\n fill: gradient.linear(..preset),\\n align(center + horizon, smallcaps(name)),\\n ))\\n)\\n
\\ngives the following stack of flags as of v0.1.0\\n
To use only one flag you only import the one you want
\\n","description":"You can use the colour palette with gradients for maximum results! For example the code in example/example.typ which is #import \\"@preview/stonewall:0.1.0\\": flags\\n\\n#set page(width: 200pt, height: auto, margin: 0pt)\\n#set text(fill: black, size: 12pt)\\n#set text(top-edge: \\"bounds…","guid":"https://typst.app/universe/package/stonewall","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-11-07T09:54:03.317Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/stonewall/0.1.0/flags.png","type":"photo","width":400,"height":1604}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"commute (0.2.0) | A proof of concept library for commutative diagrams.","url":"https://typst.app/universe/package/commute","content":"Proof-of-concept commutative diagrams library for typst
\\nSee [EricWay1024/tikzcd-editor][https://github.com/EricWay1024/tikzcd-editor]\\nfor a web-based visual diagram editor for this library!
\\n#import \\"@preview/commute:0.2.0\\": node, arr, commutative-diagram\\n\\n#align(center)[#commutative-diagram(\\n node((0, 0), $X$),\\n node((0, 1), $Y$),\\n node((1, 0), $X \\\\/ \\"ker\\"(f)$, \\"quot\\"),\\n arr($X$, $Y$, $f$),\\n arr(\\"quot\\", (0, 1), $tilde(f)$, label-pos: right, \\"dashed\\", \\"inj\\"),\\n arr($X$, \\"quot\\", $pi$),\\n)]\\n
\\nFor more usage examples look at example.typ
The library provides 3 functions: node
, arr
, and commutative-diagram
.\\nYou can clone this repo and import lib.typ
:
#import \\"path/to/commute/lib.typ\\": node, arr, commutative-diagram\\n
\\nOr directly use the builtin package manager:
\\n#import \\"@preview/commute:0.2.0\\": node, arr, commutative-diagram\\n
\\ncommutative-diagram
commutative-diagram(\\n node-padding: (70pt, 70pt),\\n arr-clearance: 0.7em,\\n padding: 1.5em,\\n debug: false,\\n ..entities\\n)\\n
\\ncommutative-diagram
returns a rectangular region containing the\\nnodes and arrows.\\nAll the unnamed arguments passed to commutative-diagram
are treated as\\nnodes or arrows of the diagram. These can be constructed using the\\nnode
and arr
functions explained below.\\nThe other arguments are as follows:
node-padding
: (length, length)
. The space to leave between adjacent nodes. It\'s a\\ntuple, (h, v)
, containing the horizontal and vertical spacing respectively.arr-clearance
: length
. The default space between arrows\' base/tip and the diagram\'s nodes.padding
: length
. The padding around the whole diagramdebug
: bool
. Whether or not to display debug information.node
node(\\n pos,\\n label,\\n id: label,\\n)\\n
\\nCreates a new diagram node. Has the following positional arguments:
\\npos
: (integer, integer)
. The position of the node in (row, column)
format.\\nMust be integers, but can be negative, the only thing that counts is the\\ndifference between the coordinares of the variuos nodes in the diagram.label
: content
. The node\'s label.id
: any
. The node\'s id, defaults to its label if not specified.arr
arr(\\n start,\\n end,\\n label,\\n start-space: none,\\n end-space: none,\\n label-pos: left,\\n curve: 0deg,\\n stroke: 0.45pt,\\n ..options\\n)\\n
\\nCreates an arrow. Has the following arguments:
\\nstart
: (integer, integer)
or any
. The position of the node from which the arrow starts,\\nin (row, column)
format, or its id.end
: (integer, integer)
or any
. The position of the node where the arrow ends,\\nin (row, column)
format, or its id.label
: content
. The label to put on the arrow.start-space
: length
. The space between the start node and the beginning of the arrow.\\nYou can pass none
to leave a sensible default, customizable using the\\narr-clearance
parameter of the commutative-diagram
function.end-space
: length
. Similar to the above.label-pos
: length
or left
or right
. Where to position the arrow\'s label relative to the arrow.\\nA positive length means that, when looking towards the tip of the arrow,\\nthe label is on the left. left
and right
measure the label to automatically get a reasonable\\nlength. If set to 0
(0
the number, which is different from 0pt
or 0em
)\\nthen the label is placed on top of the arrow, with a white background to help\\nwith legibility.curve
: angle
. The difference in orientation between the start and the end of the arrow.\\nIf positive, the arrow curves to the right, when looking towards the tip.stroke
: stroke
. The thickness and color of the arrows. The default should probably be fine.options
: string
s. After the mandatory positional arguments start
, end
and label
,\\nany remaining unnamed argument is treated as an extra option. Recognized options are:\\n\\"inj\\"
, gives the arrow a hook at the start, used for injective functions\\"surj\\"
, gives the arrow a double tip, used for surjective functions\\"bij\\"
, gives the arrow a tip also at the start, used for bijective functions\\"def\\"
, gives the arrow a bar at the start, used for function definitions\\"nat\\"
, gives the arrow a double stem, used for natural transformationsdash
parameter of Typst\'s stroke
type, such as\\n\\"dashed\\"
, \\"densely-dotted\\"
, etc. These change the appearance of the arrow\'s stemchem-par
PackageA utility package for displaying IUPAC nomenclature and chemical formulae without the hassle of manually formatting all of these in your document.
\\n#import \\"@preview/chem-par:0.0.1\\": *\\n\\n#set page(width: 30em, height: auto, margin: 1em)\\n#show: chem-style\\n\\nThe oxidation of n-butanol with K2Cr2O7 requires acidification with H2SO4 to yield butanoic acid. N,N-dimethyltryptamine.\\n
\\nWorks on most of the common things a chemist would type
\\nA Typst library for drawing graphs and plots.\\nMade by Gewi413 and Pegacraffft
\\nScatter plots
\\nGraph charts
\\nHistograms
\\nBar charts
\\nPie charts
\\nOverlaying plots/charts
\\n(more to come)
\\nTo use the package you can import it through this command import \\"@preview/plotst:0.2.0\\": *
.\\nThe documentation is found in the Docs.pdf file. It contains all functions necessary to use this library. It also includes a tutorial to create every available plot under their respective render methods.
If you need some example code, check out main.typ. It also includes a compiled version.
\\nAll these images were created using the main.typ.
\\n// Plot 1:\\n// The data to be displayed \\nlet gender_data = (\\n (\\"w\\", 1), (\\"w\\", 3), (\\"w\\", 5), (\\"w\\", 4), (\\"m\\", 2), (\\"m\\", 2),\\n (\\"m\\", 4), (\\"m\\", 6), (\\"d\\", 1), (\\"d\\", 9), (\\"d\\", 5), (\\"d\\", 8),\\n (\\"d\\", 3), (\\"d\\", 1), (0, 11)\\n)\\n\\n// Create the axes used for the chart\\nlet y_axis = axis(min: 0, max: 11, step: 1, location: \\"left\\", helper_lines: true, invert_markings: false, title: \\"foo\\")\\nlet x_axis = axis(values: (\\"\\", \\"m\\", \\"w\\", \\"d\\"), location: \\"bottom\\", helper_lines: true, invert_markings: false, title: \\"Gender\\")\\n\\n// Combine the axes and the data and feed it to the plot render function.\\nlet pl = plot(data: gender_data, axes: (x_axis, y_axis))\\nscatter_plot(pl, (100%,50%))\\n\\n// Plot 2:\\n// Same as above\\nlet data = (\\n (0, 0), (2, 2), (3, 0), (4, 4), (5, 7), (6, 6), (7, 9), (8, 5), (9, 9), (10, 1)\\n)\\nlet x_axis = axis(min: 0, max: 11, step: 2, location: \\"bottom\\")\\nlet y_axis = axis(min: 0, max: 11, step: 2, location: \\"left\\", helper_lines: false)\\nlet pl = plot(data: data, axes: (x_axis, y_axis))\\nscatter_plot(pl, (100%, 25%))\\n
\\n// The data to be displayed\\nlet data = (\\n (0, 0), (2, 2), (3, 0), (4, 4), (5, 7), (6, 6), (7, 9), (8, 5), (9, 9), (10, 1)\\n)\\n\\n// Create the axes used for the chart \\nlet x_axis = axis(min: 0, max: 11, step: 2, location: \\"bottom\\")\\nlet y_axis = axis(min: 0, max: 11, step: 2, location: \\"left\\", helper_lines: false)\\n\\n// Combine the axes and the data and feed it to the plot render function.\\nlet pl = plot(data: data, axes: (x_axis, y_axis))\\ngraph_plot(pl, (100%, 25%))\\ngraph_plot(pl, (100%, 25%), rounding: 30%, caption: \\"Graph Plot with caption and rounding\\")\\n
\\n// Plot 1:\\n// The data to be displayed\\nlet data = (\\n 18000, 18000, 18000, 18000, 18000, 18000, 18000, 18000,\\n 18000, 18000, 28000, 28000, 28000, 28000, 28000, 28000,\\n 28000, 28000, 28000, 28000, 28000, 28000, 28000, 28000,\\n 28000, 28000, 28000, 28000, 28000, 28000, 28000, 28000,\\n 35000, 46000, 75000, 95000\\n)\\n\\n// Classify the data\\nlet classes = class_generator(10000, 50000, 4)\\nclasses.push(class(50000, 100000))\\nclasses = classify(data, classes)\\n\\n// Create the axes used for the chart \\nlet x_axis = axis(min: 0, max: 100000, step: 10000, location: \\"bottom\\")\\nlet y_axis = axis(min: 0, max: 31, step: 5, location: \\"left\\", helper_lines: true)\\n\\n// Combine the axes and the data and feed it to the plot render function.\\nlet pl = plot(data: classes, axes: (x_axis, y_axis))\\nhistogram(pl, (100%, 40%), stroke: black, fill: (purple, blue, red, green, yellow))\\n\\n// Plot 2:\\n// Create the different classes\\nlet classes = ()\\nclasses.push(class(11, 13))\\nclasses.push(class(13, 15))\\nclasses.push(class(1, 6))\\nclasses.push(class(6, 11))\\nclasses.push(class(15, 30))\\n\\n// Define the data to map\\nlet data = ((20, 2), (30, 7), (16, 12), (40, 13), (5, 17))\\n\\n// Create the axes\\nlet x_axis = axis(min: 0, max: 31, step: 1, location: \\"bottom\\", show_markings: false)\\nlet y_axis = axis(min: 0, max: 41, step: 5, location: \\"left\\", helper_lines: true)\\n\\n// Classify the data\\nclasses = classify(data, classes)\\n\\n// Combine the axes and the data and feed it to the plot render function.\\nlet pl = plot(axes: (x_axis, y_axis), data: classes)\\nhistogram(pl, (100%, 40%))\\n
\\n// Plot 1:\\n// The data to be displayed\\nlet data = ((10, \\"Monday\\"), (5, \\"Tuesday\\"), (15, \\"Wednesday\\"), (9, \\"Thursday\\"), (11, \\"Friday\\"))\\n\\n// Create the necessary axes\\nlet y_axis = axis(values: (\\"\\", \\"Monday\\", \\"Tuesday\\", \\"Wednesday\\", \\"Thursday\\", \\"Friday\\"), location: \\"left\\", show_markings: true)\\nlet x_axis = axis(min: 0, max: 20, step: 2, location: \\"bottom\\", helper_lines: true)\\n\\n// Combine the axes and the data and feed it to the plot render function.\\nlet pl = plot(axes: (x_axis, y_axis), data: data)\\nbar_chart(pl, (100%, 33%), fill: (purple, blue, red, green, yellow), bar_width: 70%, rotated: true)\\n\\n// Plot 2:\\n// Same as above, but with numbers as data\\nlet data_2 = ((20, 2), (30, 7), (16, 12), (40, 13), (5, 17))\\nlet y_axis_2 = axis(min: 0, max: 41, step: 5, location: \\"left\\", show_markings: true, helper_lines: true)\\nlet x_axis_2 = axis(min: 0, max: 21, step: 1, location: \\"bottom\\")\\nlet pl_2 = plot(axes: (x_axis_2, y_axis_2), data: data_2)\\nbar_chart(pl_2, (100%, 60%), bar_width: 100%)\\n
\\nshow: r => columns(2, r)\\n\\n// create the sample data\\nlet data = ((10, \\"Male\\"), (20, \\"Female\\"), (15, \\"Divers\\"), (2, \\"Other\\")\\n\\n// Skip the axis step, as no axes are needed\\n\\n// Put the data into a plot \\nlet p = plot(data: data)\\n\\n// Display the pie_charts in all different display ways\\npie_chart(p, (100%, 20%), display_style: \\"legend-inside-chart\\")\\npie_chart(p, (100%, 20%), display_style: \\"hor-chart-legend\\")\\npie_chart(p, (100%, 20%), display_style: \\"hor-legend-chart\\")\\npie_chart(p, (100%, 20%), display_style: \\"vert-chart-legend\\")\\npie_chart(p, (100%, 20%), display_style: \\"vert-legend-chart\\")\\n
\\nOverlayed Graphs
\\n// Create the data for the two plots to overlay\\nlet data_scatter = (\\n (0, 0), (2, 2), (3, 0), (4, 4), (5, 7), (6, 6), (7, 9), (8, 5), (9, 9), (10, 1)\\n)\\nlet data_graph = (\\n (0, 3), (1, 5), (2, 1), (3, 7), (4, 3), (5, 5), (6, 7),(7, 4),(11, 6)\\n)\\n\\n// Create the axes for the overlay plot\\nlet x_axis = axis(min: 0, max: 11, step: 2, location: \\"bottom\\")\\nlet y_axis = axis(min: 0, max: 11, step: 2, location: \\"left\\", helper_lines: false)\\n\\n// create a plot for each individual plot type and save the render call\\nlet pl_scatter = plot(data: data_scatter, axes: (x_axis, y_axis))\\nlet scatter_display = scatter_plot(pl_scatter, (100%, 25%), stroke: red)\\nlet pl_graph = plot(data: data_graph, axes: (x_axis, y_axis))\\nlet graph_display = graph_plot(pl_graph, (100%, 25%), stroke: blue)\\n\\n// overlay the plots using the overlay function\\noverlay((scatter_display, graph_display), (100%, 25%))\\n
\\nBacktrack is a simple and performant Typst library that determines the current\\ncompiler version and provides an API for comparing, displaying, and observing\\nversions.
\\nUnlike the built-in version API which is only available on\\nTypst 0.9.0+, Backtrack works on any* Typst version. It uses\\nthe built-in API when available so that it\'ll continue to work on all future\\nTypst versions without modification.
\\nAdditionally, it:
\\n#import \\"@preview/backtrack:1.0.0\\": current-version, versions\\n\\nYou are using Typst #current-version.displayable!\\n#{\\n if current-version.cmpable <= versions.v2023-03-28.cmpable [\\n That is ancient.\\n ] else if current-version.cmpable < versions.v0-5-0.cmpable [\\n That is old.\\n ] else [\\n That is modern.\\n ]\\n}\\n
\\nThere are two ways to install the library:
\\n#import \\"@preview/backtrack:1.0.0\\"\\n
\\nsrc/lib.typ
to src/backtrack.typ
.COPYING
into src/
.src/
directory to backtrack/
.backtrack/
directory into your project.#import \\"[path/to/]backtrack/backtrack.typ\\"\\n
\\nSee DOCS.md. It\'s quite short. 😀
\\nBacktrack compiles on and can detect these versions:
\\n| Version | Status | Notes |\\n| -------------------- | :----: | --------------------------------------- |\\n| 0.6.0+ | ✅ | Also available as a package |\\n| March 28, 2023–0.5.0 | ✅ | |\\n| March 21, 2023 | ✅ | Initial public/standalone Typst release |\\n| February 25, 2023 | 🟡 | Detects as February 15, 2023 |\\n| February 12–15, 2023 | ✅ | |\\n| February 2, 2023 | 🟡 | Detects as January 30, 2023 |\\n| January 30, 2023 | ✅ | |
\\nThe partially-supported versions may be possible to detect, but they\'re tricky\\nsince most of their changes are content-related. Content values were opaque up\\nuntil the March 21, 2023 release, making it difficult to automatically check for\\nthe presence of these changes.
\\nCopyright © 2023 Luke Chambers
\\nBacktrack is licensed under the Apache License, Version 2.0. You can find a copy\\nof the license in COPYING or online at\\nhttps://www.apache.org/licenses/LICENSE-2.0.
\\n","description":"Backtrack is a simple and performant Typst library that determines the current compiler version and provides an API for comparing, displaying, and observing versions. Unlike the built-in version API which is only available on Typst 0.9.0+, Backtrack works on any* Typst version…","guid":"https://typst.app/universe/package/backtrack","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-10-27T10:46:42.967Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"bob-draw (0.1.0) | svgbob for typst, powered by wasm","url":"https://typst.app/universe/package/bob-draw","content":"bob-draw
svgbob for typst, powered by wasm
\\nThis package provides a typst plugin for rendering svgbob diagrams.
\\n#import \\"@preview/bob-draw:0.1.0\\": *\\n#render(```\\n /\\\\_/\\\\\\nbob -> ( o.o )\\n \\\\ \\" /\\n .------/ /\\n ( | |\\n `====== o o\\n```)\\n
\\noutput:
\\n#import \\"@preview/bob-draw:0.1.0\\": *\\n#show raw.where(lang: \\"bob\\"): it => render(it)\\n\\n#let svg = bob2svg(\\"<---\x3e\\")\\n#render(\\"<---\x3e\\")\\n#render(\\n ```\\n 0 3 \\n *-------* \\n 1 /| 2 /| \\n *-+-----* | \\n | |4 | |7\\n | *-----|-*\\n |/ |/\\n *-------*\\n 5 6\\n ```,\\n width: 25%,\\n)\\n\\n```bob\\n\\"cats:\\"\\n /\\\\_/\\\\ /\\\\_/\\\\ /\\\\_/\\\\ /\\\\_/\\\\ \\n( o.o )( o.o )( o.o )( o.o )\\n```\\n
\\n","description":"svgbob for typst, powered by wasm This package provides a typst plugin for rendering svgbob diagrams.\\n\\n#import \\"@preview/bob-draw:0.1.0\\": *\\n#render(```\\n /\\\\_/\\\\\\nbob -> ( o.o )\\n \\\\ \\" /\\n .------/ /\\n ( | |\\n `====== o o\\n```)\\n\\n\\noutput:\\n\\nFull example\\n#import…","guid":"https://typst.app/universe/package/bob-draw","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-10-24T11:32:53.868Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/bob-draw/0.1.0/examples/basic-example.svg","type":"photo","width":283,"height":141}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"funarray (0.4.0) | Package providing convenient functional functions to use on arrays.","url":"https://typst.app/universe/package/funarray","content":"This package provides some convinient functional functions for typst to use on arrays.
\\nTo use this package simply #import \\"@preview/funarray:0.3.0\\"
. To import all functions use : *
and for specific ones, use either the module or as described in the typst docs.
Almost all functions are one-liners, which could, instead of being loaded via a package import, also be just copied directly into your source files.
\\nA prettier und easier to read version of the documentation exists in the example folder, which is done in typst and exported to pdf. Otherwise, bellow is the markdown version.
\\nLet us define\\na = (1, \\"not prime\\", 2, \\"prime\\", 3, \\"prime\\", 4, \\"not prime\\", 5, \\"prime\\")
The chunks function translates the array to an array of array. It groups the elements to chunks of a given size and collects them in an bigger array.
\\nchunks(a, 2) = ( (1, \\"not prime\\"), (2, \\"prime\\"), (3, \\"prime\\"), (4, \\"not prime\\"), (5, \\"prime\\") )
The unzip function is the inverse of the zip method, it transforms an array of pairs to a pair of vectors. You can also give input an array of n
-tuples resulting in in n
arrays.
unzip(b) = ( (1, 2, 3, 4, 5), ( \\"not prime\\", \\"prime\\", \\"prime\\", \\"not prime\\", \\"prime\\" ) )
The cycle function concatenates the array to itself until it has a given size.
\\nlet c = cycle(range(5), 8)\\nc = (0, 1, 2, 3, 4, 0, 1, 2)\\n
\\nNote that there is also the functionality to concatenate with +
and *
in typst.
This function provides a running window
\\nwindows(c, 5) = ( (0, 1, 2, 3, 4), (1, 2, 3, 4, 0), (2, 3, 4, 0, 1), (3, 4, 0, 1, 2) )
whereas the circular version wraps over.
\\ncircular-windows(c, 5) = ( (0, 1, 2, 3, 4), (1, 2, 3, 4, 0), (2, 3, 4, 0, 1), (3, 4, 0, 1, 2), (4, 0, 1, 2, 4), (0, 1, 2, 4, 0), (1, 2, 4, 0, 1), (2, 4, 0, 1, 2) )
The partition function seperates the array in two according to a predicate function. The result is an array with all elements, where the predicate returned true followed by an array with all elements, where the predicate returned false.
\\nlet (primesp, nonprimesp) = partition(b, x => x.at(1) == \\"prime\\")\\nprimesp = ((2, \\"prime\\"), (3, \\"prime\\"), (5, \\"prime\\"))\\nnonprimesp = ((1, \\"not prime\\"), (4, \\"not prime\\"))\\n
\\nThere is also a partition-map function, which after partition also applies a second function on both collections.
\\nlet (primes, nonprimes) = partition-map(b, x => x.at(1) == \\"prime\\", x => x.at(0))\\nprimes = (2, 3, 5)\\nnonprimes = (1, 4)\\n
\\nThis functions groups according to a predicate into maximally sized chunks, where all elements have the same predicate value.
\\nlet f = (0,0,1,1,1,0,0,1)\\nlet g = group-by(f, x => x == 0)\\ng = ((0, 0), (1, 1, 1), (0, 0), (1,))\\n
\\nTypst has a flatten
method for arrays, however that method acts recursively. For instance
(((1,2,3), (2,3)), ((1,2,3), (1,2))).flatten() = (1, 2, 3, 2, 3, 1, 2, 3, 1, 2)
Normally, one would only have flattened one level. To do this, we can use the typst array concatenation method +, or by folding, the sum method for arrays:
\\n(((1,2,3), (2,3)), ((1,2,3), (1,2))).sum() = ((1, 2, 3), (2, 3), (1, 2, 3), (1, 2))
To handle further depth, one can use flatten again, so that in our example:
\\n(((1,2,3), (2,3)), ((1,2,3), (1,2))).sum().sum() = (((1,2,3), (2,3)), ((1,2,3), (1,2))).flatten()
This function has been removed in version 0.3, as typst 0.8 provides such functionality by default.
\\nThese functions do exactly as they say.
\\ntake-while(h, x => x < 1) = (0, 0, 0.25, 0.5, 0.75)\\nskip-while(h, x => x < 1) = (1, 1, 1, 0.25, 0.5, 0.75, 0, 0, 0.25, 0.5, 0.75, 1)\\n
\\nThe core functions are defined in funarray-unsafe.typ
. However, assertions (error checking) are not there and it is generally not being advised to use these directly. Still, if being cautious, one can use the imported funarray-unsafe
module in funarray(.typ)
. All function names are the same.
To do this from the package, do as follows:
\\n#import @preview/funarray:0.3.0\\n\\n#funarray.funarray-unsafe.chunks(range(10), 3)\\n
\\n","description":"This package provides some convinient functional functions for typst to use on arrays. Usage\\n\\nTo use this package simply #import \\"@preview/funarray:0.3.0\\". To import all functions use : * and for specific ones, use either the module or as described in the typst docs.\\n\\nImportant…","guid":"https://typst.app/universe/package/funarray","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-10-24T08:27:49.640Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"ionio-illustrate (0.2.0) | Mass spectra with annotations for typst.","url":"https://typst.app/universe/package/ionio-illustrate","content":"\\nionio-illustrate
packageThis package implements a Cetz chart-like object for displying mass spectrometric data in Typst documents. It allows for individually styled mass peaks, callouts, titles, and mass callipers.\\n
\\n Explore the docs »\\n
\\n
\\n Report Bug\\n ·\\n Request Feature\\n
To make use of the ionio-illustrate
package, you\'ll need to add it to your project like shown below. Make sure you are importing a version that supports your end goal.
#import \\"@preview/ionio-illustrate:0.2.0\\": *\\n
\\nThen, load in your mass spectrum data and pass it through to the package like so. Data should be 2D array, and by default the mass-charge ratio is in the first column, and the relative intensities are in the second column.
\\n#let data = csv(\\"isobutelene_epoxide.csv\\")\\n\\n#let ms = mass-spectrum(massspec, args: (\\n size: (12,6),\\n range: (0,100),\\n)) \\n\\n#figure((ms.display)())\\n
\\nThere are many ways to further enhance your spectrum, please check out the manual to find out how.
\\n\\n\\nSee the open issues for a full list of proposed features (and known issues).
\\n\\n\\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
\\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \\"enhancement\\".\\nDon\'t forget to give the project a star! Thanks again!
\\ngit checkout -b feature/AmazingFeature
)git commit -m \'Add some AmazingFeature\'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.
Create Gantt charts automatically with Typst!
\\nHere\'s a fully-featured example:
\\n#import \\"@preview/timeliney:0.1.0\\"\\n\\n#timeliney.timeline(\\n show-grid: true,\\n {\\n import timeliney: *\\n \\n headerline(group(([*2023*], 4)), group(([*2024*], 4)))\\n headerline(\\n group(..range(4).map(n => strong(\\"Q\\" + str(n + 1)))),\\n group(..range(4).map(n => strong(\\"Q\\" + str(n + 1)))),\\n )\\n \\n taskgroup(title: [*Research*], {\\n task(\\"Research the market\\", (0, 2), style: (stroke: 2pt + gray))\\n task(\\"Conduct user surveys\\", (1, 3), style: (stroke: 2pt + gray))\\n })\\n\\n taskgroup(title: [*Development*], {\\n task(\\"Create mock-ups\\", (2, 3), style: (stroke: 2pt + gray))\\n task(\\"Develop application\\", (3, 5), style: (stroke: 2pt + gray))\\n task(\\"QA\\", (3.5, 6), style: (stroke: 2pt + gray))\\n })\\n\\n taskgroup(title: [*Marketing*], {\\n task(\\"Press demos\\", (3.5, 7), style: (stroke: 2pt + gray))\\n task(\\"Social media advertising\\", (6, 7.5), style: (stroke: 2pt + gray))\\n })\\n\\n milestone(\\n at: 3.75,\\n style: (stroke: (dash: \\"dashed\\")),\\n align(center, [\\n *Conference demo*\\\\\\n Dec 2023\\n ])\\n )\\n\\n milestone(\\n at: 6.5,\\n style: (stroke: (dash: \\"dashed\\")),\\n align(center, [\\n *App store launch*\\\\\\n Aug 2024\\n ])\\n )\\n }\\n)\\n
\\nImport with #import \\"@preview/timeliney:0.1.0\\"
. Then, call the timeliney.timeline
function.
See the manual!
\\nMake your equations more fruity!
\\nThis package automatically replaces any single letters in equations with fruit emoji.
\\nRefer to example-documentation.pdf
for more detail.
Until 0.12, typst did not have good emoji support for PDF.\\nThis meant that even though this package worked as intended,\\nthe output would look very wrong when exporting to PDF.\\nTherefore, it is recommended to stick with PNG export for those older typst versions.
\\n","description":"Make your equations more fruity! This package automatically replaces any single letters in equations with fruit emoji.\\n\\nRefer to example-documentation.pdf for more detail.\\n\\nEmoji support\\n\\nUntil 0.12, typst did not have good emoji support for PDF. This meant that even though this…","guid":"https://typst.app/universe/package/fruitify","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-10-11T09:03:30.379Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"hidden-bib (0.1.1) | Create hidden bibliographies or bibliographies with unmentioned (hidden) citations.","url":"https://typst.app/universe/package/hidden-bib","content":"GitHub Repository including Examples
\\nA Typst package to create hidden bibliographies or bibliographies with unmentioned (hidden) citations.
\\nIn some documents, such as a letter, you may want to cite a reference without printing a bibliography.
\\nThis can easily be achieved by wrapping your bibliography(...)
with the hidden-bibliography
function after importing the hidden-bib
package.
The code then looks like this:
\\n#import \\"@preview/hidden-bib:0.1.0\\": hidden-bibliography\\n\\n#lorem(20) @example1\\n#lorem(40) @example2[p. 2]\\n\\n#hidden-bibliography(\\n bibliography(\\"/refs.yml\\")\\n)\\n
\\nNote that this automatically sets the style
option to \\"chicago-notes\\"
unless you specify a different style.
In some documents, it may be necessary to include items in your bibliography which weren\'t explicitly cited at any specific point in your document.
\\nThe code then looks like this:
\\n#import \\"@preview/hidden-bib:0.1.0\\": hidden-cite\\n\\n#hidden-cite(\\"example1\\")\\n
\\nIf you want to include a large number of items in your bibliography without having to use hidden-cite
(to still get autocompletion in the web editor), you can use the hidden-citations
environment.
The code then looks like this:
\\n#import \\"@preview/hidden-bib:0.1.0\\": hidden-citations\\n\\n#hidden-citations[\\n @example1\\n @example2\\n]\\n
\\nYou don\'t. While this package solves both (related) problems, you should only use one of them at a time. Otherwise, you\'ll simply see nothing at all.
\\nThat\'s for you to decide. It essentially enables you to include \\"uncited references\\", similar to LaTeX\'s \\\\nocite{}
command.
This package is licensed under the MIT license. See the LICENSE file for details.
\\n","description":"GitHub Repository including Examples A Typst package to create hidden bibliographies or bibliographies with unmentioned (hidden) citations.\\n\\nUse Cases\\nHidden Bibliographies\\n\\nIn some documents, such as a letter, you may want to cite a reference without printing a bibliography.\\n\\nThis…","guid":"https://typst.app/universe/package/hidden-bib","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-10-10T09:06:41.491Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"name-it (0.1.1) | Get the English names of integers.","url":"https://typst.app/universe/package/name-it","content":"Get the English names of integers.
\\n#import \\"@preview/name-it:0.1.0\\": name-it\\n\\n#set page(width: auto, height: auto, margin: 1cm)\\n\\n- #name-it(-5)\\n- #name-it(-5, negative-prefix: \\"minus\\")\\n- #name-it(0)\\n- #name-it(1)\\n- #name-it(10)\\n- #name-it(11)\\n- #name-it(42)\\n- #name-it(100)\\n- #name-it(110)\\n- #name-it(1104)\\n- #name-it(11040)\\n- #name-it(11000)\\n- #name-it(110000)\\n- #name-it(1100004)\\n- #name-it(10000000000006)\\n- #name-it(10000000000006, show-and: false)\\n- #name-it(\\"200000000000000000000000007\\")\\n
\\nname-it
Convert the given number into its English word representation.
\\n#let name-it(num, show-and: true, negative-prefix: \\"negative\\") = { .. }\\n
\\nArguments:
\\nnum
: int
,str
— The number to name.show-and
: bool
— Whether an “and” should be used in certain\\nplaces. For example, “one hundred ten” vs “one hundred and ten”.negative-prefix
: str
— The prefix to use for negative numbers.Showybox is a Typst package for creating colorful and customizable boxes.
\\nTo use this library through the Typst package manager (for Typst 0.6.0 or greater), write #import \\"@preview/showybox:2.0.2\\": showybox
at the beginning of your Typst file.
Once imported, you can create an empty showybox by using the function showybox()
and giving a default body content inside the parenthesis or outside them using squared brackets []
.
By default a showybox
with these properties will be created:
5pt
of border radius1pt
of border thickness#import \\"@preview/showybox:2.0.3\\": showybox\\n\\n#showybox(\\n [Hello world!]\\n)\\n
\\nLooks quite simple, but the \\"magic\\" starts when adding a title, color and shadows. The following code creates two \\"unique\\" boxes with defined colors and custom borders:
\\n// First showybox\\n#showybox(\\n frame: (\\n border-color: red.darken(50%),\\n title-color: red.lighten(60%),\\n body-color: red.lighten(80%)\\n ),\\n title-style: (\\n color: black,\\n weight: \\"regular\\",\\n align: center\\n ),\\n shadow: (\\n offset: 3pt,\\n ),\\n title: \\"Red-ish showybox with separated sections!\\",\\n lorem(20),\\n lorem(12)\\n)\\n\\n// Second showybox\\n#showybox(\\n frame: (\\n dash: \\"dashed\\",\\n border-color: red.darken(40%)\\n ),\\n body-style: (\\n align: center\\n ),\\n sep: (\\n dash: \\"dashed\\"\\n ),\\n shadow: (\\n offset: (x: 2pt, y: 3pt),\\n color: yellow.lighten(70%)\\n ),\\n [This is an important message!],\\n [Be careful outside. There are dangerous bananas!]\\n)\\n
\\nThe showybox()
function can receive the following parameters:
title
: A string used as the title of the showyboxfooter
: A string used as the footer of the showyboxframe
: A dictionary containing the frame\'s propertiestitle-style
: A dictionary containing the title\'s stylesbody-style
: A dictionary containing the body\'s stylesfooter-style
: A dictionary containing the footer\'s stylessep
: A dictionary containing the separator\'s propertiesshadow
: A dictionary containing the shadow\'s propertieswidth
: A relative length indicating the showybox\'s widthalign
: An unidimensional alignement for the showybox in the pagebreakable
: A boolean indicating whether a showybox can break if it reached an end of pagespacing
: Space above and below the showyboxabove
: Space above the showyboxbelow
: Space below the showyboxbody
: The content of the showyboxtitle-color
: Color used as background color where the title goes (default is black
)body-color
: Color used as background color where the body goes (default is white
)footer-color
: Color used as background color where the footer goes (default is luma(85)
)border-color
: Color used for the showybox\'s border (default is black
)inset
: Inset used for title, body and footer elements (default is (x: 1em, y: 0.65em)
) if none of the followings are given:\\ntitle-inset
: Inset used for the titlebody-inset
: Inset used for the bodyfooter-inset
: Inset used for the bodyradius
: Showybox\'s radius (default is 5pt
)thickness
: Border thickness of the showybox (default is 1pt
)dash
: Showybox\'s border style (default is solid
)color
: Text color (default is white
)weight
: Text weight (default is bold
)align
: Text align (default is left
)sep-thickness
: Thickness of the separator between title and body (default is 1pt
)boxed-style
: If it\'s a dictionary of properties, indicates that the title must appear like a \\"floating box\\" above the showybox. If it\'s none
, the title appears normally (default is none
)anchor
: Anchor of the boxed title\\ny
: Vertical anchor (top
, horizon
or bottom
-- default is horizon
)x
: Horizontal anchor (left
, start
, center
, right
, end
-- default is left
)offset
: How much to offset the boxed title in x and y direction as a dictionary with keys x
and y
(default is 0pt
)radius
: Boxed title radius as a dictionary or relative length (default is 5pt
)color
: Text color (default is black
)align
: Text align (default is left
)color
: Text color (default is luma(85)
)weight
: Text weight (default is regular
)align
: Text align (default is left
)sep-thickness
: Thickness of the separator between body and footer (default is 1pt
)thickness
: Separator\'s thickness (default is 1pt
)dash
: Separator\'s style (as a line
dash style, default is \\"solid\\"
)gutter
: Separator\'s space above and below (defalut is 0.65em
)color
: Shadow color (default is black
)offset
: How much to offset the shadow in x and y direction either as a length or a dictionary with keys x
and y
(default is 4pt
)anchor
inside a figure
breakable
behaviour of showyboxes inside a figure
Special thanks to Andrew Voynov (https://github.com/Andrew15-5) for the feedback while creating the new behaviours for boxed-titles
\\ntype()
conditionals to Typst 0.8.0 standardsboxed-style
property, with anchor
, offset
and radius
properties.showy-inset()
for being general-purpose. Now it\'s called showy-value-in-direction()
and has a default value for handling properties defaultsradius
(e.g. radius: (top: 5pt, bottom: 0pt)
). Before this only was possible for untitled showyboxes.offset
value.width
of less than 100%
, and a shadow.boxed
option in title stylesboxed-align
in title stylessep-thickness
for title and footerChanges below were performed by Jonas Neugebauer (https://github.com/jneug)
\\ntitle-inset
, body-inset
, footer-inset
and inset
options\\ntitle-inset
, body-inset
and footer-inset
will set the inset of the title, body and footer area respectively. inset
is a fallback for those areas.sep.gutter
option to set the spacing around separator lineswidth
to set the width of a showyboxalign
to move a showybox with width
< 100% along the x-axis\\nspacing
, above
and below
to #showybox()
.footer
and footer-style
options\\nAll changes listed here were performed by Jonas Neugebauer (https://github.com/jneug)
\\nshadow
optionbreakable
) functionality for titled showyboxes0pt
, probably due to some \\"fixes\\" improved to manage default spacing between rect
elements. The issue was solved by avoiding #set
statements and adding a #v(-1.1em)
to correct extra spacing between the title rect
and the body rect
.The name idwtet
stands for \\"I Don\'t Wanna Type Everything Twice\\". It provides a typst-ex
and a typst-ex-code
codeblock, which shows and executes typst code.
It is meant for code demonstration, e.g. when publishing a package, and provides some niceties:
\\nHowever, there are some limitations:
\\neval-scope
argument, which captures variables and simulates global variables. Additionally, a typst
codeblock is provided for a consistent look.typst-ex-code
, but typst-ex
does not provide such functionality. It might thus be difficult for users to understand code examples this way.Only one function is defined,\\ninit(body, bcolor: luma(210), inset: 5pt, border: 2pt, radius: 2pt, content-font: \\"linux libertine\\", code-font-size: 9pt, content-font-size: 11pt, code-return-box: true, wrap-code: false, eval-scope: (:), escape-bracket: \\"%\\")
,\\nwhich is supposed to be used with a show rule.
Then raw codeblocks (with block=true
) of the languages typst
, typst-ex
, typst-code
and typst-ex-code
are modified. The main feature of this package are typst-ex
and typst-ex-code
. The typst
and typst-code
blocks do not evaluate anything, but their design fits that of the others.
The parameters of init
are:
body
: for usage with show rule, hence the whole document.bcolor
: the background- (and border-) color of the blocksinset
: inset param of code and content blocks, should be ≥ 2ptborder
: border thicknessradius
: block radiuscontent-font
: The font used in the previewed content / result.code-font-size
: The fontsize used in the code blocks.content-font-size
: The fontsize used in the preview content / result.code-return-box
: If to show the code return type on typst-ex-code
blocks.wrap-code
: If to wrap the code in #{
and }
, to symbolize local scope.eval-scope
: A dictionary with the keys as the variable names and the values as another dictionary with keys value
and code
, both of these are optional. The former has the defined value, the latter the code recreate the variable, for usage in the code blocks.escape-bracket
: The text to wrap a variable with, to access the code
part of a eval-scope
variable.There are currently two methods to change the code:
\\neval-scope
argument from the init
function. There is a code
field in the dictionaries, which enables the usage of the key escaped in escape-bracket
to be replaced in the codeblock code half and to be removed in the codeblock result half, as the value is given via scope. Take a look at the example below, where %ouset%
is used this way.ENDHIDDEN
feature. When escaped in escape-bracket
, everything above the statement is removed from the codeblock code half BUT everything (without the ENDHIDDEN
statement) is evaluated. Take a look at the example in the examples folder.#set page(margin: 0.5cm, width: 14cm, height: auto)\\n#import \\"@preview/idwtet:0.1.0\\"\\n#show: idwtet.init.with(eval-scope: (\\n ouset: (\\n value: {import \\"@preview/ouset:0.1.1\\": ouset; ouset},\\n code: \\"#import \\\\\\"@preview/ouset:0.1.1\\\\\\": ouset\\"\\n )\\n))\\n\\n== ouset package #text(gray)[(v0.1.1)]\\n```typst-ex\\n%ouset%\\n$\\n\\"Expression 1\\" ouset(&, <==>, \\"Theorem 1\\") \\"Expression 2\\"\\\\\\n ouset(&, ==>,, \\"Theorem 7\\") \\"Expression 3\\"\\n$\\n```\\nOr something like\\n```typst-ex-code\\nlet a = range(10)\\na\\n```\\n
\\nFurther examples are given in the repo example folder.
\\n","description":"The name idwtet stands for \\"I Don\'t Wanna Type Everything Twice\\". It provides a typst-ex and a typst-ex-code codeblock, which shows and executes typst code. It is meant for code demonstration, e.g. when publishing a package, and provides some niceties:\\n\\nthe code should always be…","guid":"https://typst.app/universe/package/idwtet","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-09-25T11:01:56.400Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"codetastic (0.2.2) | Generate all sorts of codes in Typst.","url":"https://typst.app/universe/package/codetastic","content":"Codetastic is a Typst package for drawing barcodes and 2d codes.
\\nFor Typst 0.6.0 or later, import the package from the Typst preview repository:
\\n#import \\"@preview/codetastic:0.2.2\\"\\n
\\nAfter importing the package call any of the code generation functions:
\\n#import \\"@preview/codetastic:0.2.2\\": ean13, qrcode\\n\\n#ean13(4012345678901)\\n\\n#qrcode(\\"https://github.com/typst/typst\\")\\n
\\nThe output should look like this:\\n
See manual.pdf
for a full manual of the package.
The documentation is created using Mantys, a Typst template for creating package documentation.
\\nTo compile the manual, Mantys needs to be available as a local package. Refer to Mantys\' manual for instructions on how to do so.
\\nwidth
key.\\nfinite is a Typst package for rendering finite automata on top of CeTZ.
\\nFor Typst 0.6.0 or later, import the package from the typst preview repository:
\\n#import \\"@preview/finite:0.3.2\\": automaton\\n
\\nAfter importing the package, simply call #automaton()
with a dictionary holding a transition table:
#import \\"@preview/finite:0.3.2\\": automaton\\n\\n#automaton((\\n q0: (q1:0, q0:\\"0,1\\"),\\n q1: (q0:(0,1), q2:\\"0\\"),\\n q2: (),\\n))\\n
\\nThe output should look like this:\\n
See manual.pdf
for a full manual of the package.
The documentation is created using Mantys, a Typst template for creating package documentation.
\\nTo compile the manual, Mantys needs to be available as a local package. Refer to Mantys\' manual for instructions on how to do so.
\\nstroke
sets a stroke for the marking.scale
scales the marking by a factor.automaton
command:\\nlabel-format
argument to state-format
and input-format
.layout
can now take a dictionary with (state
: coordinate
) pairs to position states.#powerset
command, to transform a NFA into a DFA.#add-trap
command, to complete a partial DFA.#accepts
command, to test a word against an NFA or DFA.transpose-table
and get-inputs
utilities.curve
option to be the height of the arc of the transition.\\nrest
key to custom layouts.A Typst library for writing algorithms. On Typst v0.6.0+ you can import the algo
package:
#import \\"@preview/algo:0.3.3\\": algo, i, d, comment, code\\n
\\nOtherwise, add the algo.typ
file to your project and import it as normal:
#import \\"algo.typ\\": algo, i, d, comment, code\\n
\\nUse the algo
function for writing pseudocode and the code
function for writing code blocks with line numbers. Check out the examples below for a quick overview. See the usage section to read about all the options each function has.
Here\'s a basic use of algo
:
#algo(\\n title: \\"Fib\\",\\n parameters: (\\"n\\",)\\n)[\\n if $n < 0$:#i\\\\ // use #i to indent the following lines\\n return null#d\\\\ // use #d to dedent the following lines\\n if $n = 0$ or $n = 1$:#i #comment[you can also]\\\\\\n return $n$#d #comment[add comments!]\\\\\\n return #smallcaps(\\"Fib\\")$(n-1) +$ #smallcaps(\\"Fib\\")$(n-2)$\\n]\\n
\\nHere\'s a use of algo
without a title, parameters, line numbers, or syntax highlighting:
#algo(\\n line-numbers: false,\\n strong-keywords: false\\n)[\\n if $n < 0$:#i\\\\\\n return null#d\\\\\\n if $n = 0$ or $n = 1$:#i\\\\\\n return $n$#d\\\\\\n \\\\\\n let $x <- 0$\\\\\\n let $y <- 1$\\\\\\n for $i <- 2$ to $n-1$:#i #comment[so dynamic!]\\\\\\n let $z <- x+y$\\\\\\n $x <- y$\\\\\\n $y <- z$#d\\\\\\n \\\\\\n return $x+y$\\n]\\n
\\nAnd here\'s algo
with more styling options:
#algo(\\n title: [ // note that title and parameters\\n #set text(size: 15pt) // can be content\\n #emph(smallcaps(\\"Fib\\"))\\n ],\\n parameters: ([#math.italic(\\"n\\")],),\\n comment-prefix: [#sym.triangle.stroked.r ],\\n comment-styles: (fill: rgb(100%, 0%, 0%)),\\n indent-size: 15pt,\\n indent-guides: 1pt + gray,\\n row-gutter: 5pt,\\n column-gutter: 5pt,\\n inset: 5pt,\\n stroke: 2pt + black,\\n fill: none,\\n)[\\n if $n < 0$:#i\\\\\\n return null#d\\\\\\n if $n = 0$ or $n = 1$:#i\\\\\\n return $n$#d\\\\\\n \\\\\\n let $x <- 0$\\\\\\n let $y <- 1$\\\\\\n for $i <- 2$ to $n-1$:#i #comment[so dynamic!]\\\\\\n let $z <- x+y$\\\\\\n $x <- y$\\\\\\n $y <- z$#d\\\\\\n \\\\\\n return $x+y$\\n]\\n
\\n\\n
Here\'s a basic use of code
:
#code()[\\n ```py\\n def fib(n):\\n if n < 0:\\n return None\\n if n == 0 or n == 1: # this comment is\\n return n # normal raw text\\n return fib(n-1) + fib(n-2)\\n ```\\n]\\n
\\nAnd here\'s code
with some styling options:
#code(\\n indent-guides: 1pt + gray,\\n row-gutter: 5pt,\\n column-gutter: 5pt,\\n inset: 5pt,\\n stroke: 2pt + black,\\n fill: none,\\n)[\\n ```py\\n def fib(n):\\n if n < 0:\\n return None\\n if n == 0 or n == 1: # this comment is\\n return n # normal raw text\\n return fib(n-1) + fib(n-2)\\n ```\\n]\\n
\\nalgo
Makes a pseudocode element.
\\nalgo(\\n body,\\n header: none,\\n title: none,\\n parameters: (),\\n line-numbers: true,\\n strong-keywords: true,\\n keywords: _algo-default-keywords, // see below\\n comment-prefix: \\"// \\",\\n indent-size: 20pt,\\n indent-guides: none,\\n indent-guides-offset: 0pt,\\n row-gutter: 10pt,\\n column-gutter: 10pt,\\n inset: 10pt,\\n fill: rgb(98%, 98%, 98%),\\n stroke: 1pt + rgb(50%, 50%, 50%),\\n radius: 0pt,\\n breakable: false,\\n block-align: center,\\n main-text-styles: (:),\\n comment-styles: (fill: rgb(45%, 45%, 45%)),\\n line-number-styles: (:)\\n)\\n
\\nParameters:
\\nbody
: content
— Main algorithm content.
header
: content
— Algorithm header. If specified, title
and parameters
are ignored.
title
: string
or content
— Algorithm title. Ignored if header
is specified.
Parameters
: array
— List of algorithm parameters. Elements can be string
or content
values. string
values will automatically be displayed in math mode. Ignored if header
is specified.
line-numbers
: boolean
— Whether to display line numbers.
strong-keywords
: boolean
— Whether to strongly emphasize keywords.
keywords
: array
— List of terms to receive strong emphasis. Elements must be string
values. Ignored if strong-keywords
is false
.
The default list of keywords is stored in _algo-default-keywords
. This list contains the following terms:
(\\"if\\", \\"else\\", \\"then\\", \\"while\\", \\"for\\",\\n\\"repeat\\", \\"do\\", \\"until\\", \\":\\", \\"end\\",\\n\\"and\\", \\"or\\", \\"not\\", \\"in\\", \\"to\\",\\n\\"down\\", \\"let\\", \\"return\\", \\"goto\\")\\n
\\nNote that for each of the above terms, _algo-default-keywords
also contains the uppercase form of the term (e.g. \\"for\\" and \\"For\\").
comment-prefix
: content
— What to prepend comments with.
indent-size
: length
— Size of line indentations.
indent-guides
: stroke
— Stroke for indent guides.
indent-guides-offset
: length
— Horizontal offset of indent guides.
row-gutter
: length
— Space between lines.
column-gutter
: length
— Space between line numbers, text, and comments.
inset
: length
— Size of inner padding.
fill
: color
— Fill color.
stroke
: stroke
— Stroke for the element\'s border.
radius
: length
— Corner radius.
breakable
: boolean
— Whether the element can break across pages. WARNING: indent guides may look off when broken across pages.
block-align
: none
or alignment
or 2d alignment
— Alignment of the algo
on the page. Using none
will cause the internal block
element to be returned as-is.
main-text-styles
: dictionary
— Styling options for the main algorithm text. Supports all parameters in Typst\'s native text
function.
comment-styles
: dictionary
— Styling options for comment text. Supports all parameters in Typst\'s native text
function.
line-number-styles
: dictionary
— Styling options for line numbers. Supports all parameters in Typst\'s native text
function.
i
and d
For use in an algo
body. #i
indents all following lines and #d
dedents all following lines.
comment
For use in an algo
body. Adds a comment to the line in which it\'s placed.
comment(\\n body,\\n inline: false\\n)\\n
\\nParameters:
\\nbody
: content
— Comment content.
inline
: boolean
— If true, the comment is displayed in place rather than on the right side.
NOTE: inline comments will respect both main-text-styles
and comment-styles
, preferring comment-styles
when the two conflict.
NOTE: to make inline comments insensitive to strong-keywords
, strong emphasis is disabled within them. This can be circumvented via the text
function:
#comment(inline: true)[#text(weight: 700)[...]]\\n
\\nno-emph
For use in an algo
body. Prevents the passed content from being strongly emphasized. If a word appears in your algorithm both as a keyword and as normal text, you may escape the non-keyword usages via this function.
no-emph(\\n body\\n)\\n
\\nParameters:
\\nbody
: content
— Content to display without emphasis.code
Makes a code block element.
\\ncode(\\n body,\\n line-numbers: true,\\n indent-guides: none,\\n indent-guides-offset: 0pt,\\n tab-size: auto,\\n row-gutter: 10pt,\\n column-gutter: 10pt,\\n inset: 10pt,\\n fill: rgb(98%, 98%, 98%),\\n stroke: 1pt + rgb(50%, 50%, 50%),\\n radius: 0pt,\\n breakable: false,\\n block-align: center,\\n main-text-styles: (:),\\n line-number-styles: (:)\\n)\\n
\\nParameters:
\\nbody
: content
— Main content. Expects raw
text.
line-numbers
: boolean
— Whether to display line numbers.
indent-guides
: stroke
— Stroke for indent guides.
indent-guides-offset
: length
— Horizontal offset of indent guides.
tab-size
: integer
— Amount of spaces that should be considered an indent. If unspecified, the tab size is determined automatically from the first instance of starting whitespace.
row-gutter
: length
— Space between lines.
column-gutter
: length
— Space between line numbers and text.
inset
: length
— Size of inner padding.
fill
: color
— Fill color.
stroke
: stroke
— Stroke for the element\'s border.
radius
: length
— Corner radius.
breakable
: boolean
— Whether the element can break across pages. WARNING: indent guides may look off when broken across pages.
block-align
: none
or alignment
or 2d alignment
— Alignment of the code
on the page. Using none
will cause the internal block
element to be returned as-is.
main-text-styles
: dictionary
— Styling options for the main raw text. Supports all parameters in Typst\'s native text
function.
line-number-styles
: dictionary
— Styling options for line numbers. Supports all parameters in Typst\'s native text
function.
PRs are welcome! And if you encounter any bugs or have any requests/ideas, feel free to open an issue.
\\n","description":"A Typst library for writing algorithms. On Typst v0.6.0+ you can import the algo package: #import \\"@preview/algo:0.3.3\\": algo, i, d, comment, code\\n\\n\\nOtherwise, add the algo.typ file to your project and import it as normal:\\n\\n#import \\"algo.typ\\": algo, i, d, comment, code\\n\\n\\nUse the al…","guid":"https://typst.app/universe/package/algo","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-09-21T07:29:34.445Z","media":[{"url":"https://user-images.githubusercontent.com/40146328/235323240-e59ed7e2-ebb6-4b80-8742-eb171dd3721e.png","type":"photo","width":1061,"height":499},{"url":"https://user-images.githubusercontent.com/40146328/235323261-d6e7a42c-ffb7-4c3a-bd2a-4c8fc2df5f36.png","type":"photo","width":723,"height":888},{"url":"https://github.com/platformer/typst-algorithms/assets/40146328/89f80b5d-bdb2-420a-935d-24f43ca597d8","type":"photo","width":814,"height":823},{"url":"https://user-images.githubusercontent.com/40146328/235324088-a3596e0b-af90-4da3-b326-2de11158baac.png","type":"photo","width":1103,"height":473},{"url":"https://github.com/platformer/typst-algorithms/assets/40146328/c091ac43-6861-40bc-8046-03ea285712c3","type":"photo","width":1230,"height":381}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"t4t (0.3.2) | A utility package for typst package authors","url":"https://typst.app/universe/package/t4t","content":"\\n\\nA utility package for typst package authors.
\\n
Tools for Typst (t4t
in short) is a utility package for Typst package and template authors. It provides solutions to some recurring tasks in package development.
The package can be imported or any useful parts of it copied into a project. It is perfectly fine to treat t4t
as a snippet collection and to pick and choose only some useful functions. For this reason, most functions are implemented without further dependencies.
Hopefully, this collection will grow over time with Typst to provide solutions for common problems.
\\nEither import the package from the Typst preview repository:
\\n#import \\"@preview/t4t:0.3.2\\": *\\n
\\nIf only a few functions from t4t
are needed, simply copy the necessary code to the beginning of the document.
Note: This reference might be out of date. Please refer to the manual for a complete overview of all functions.
\\nThe functions are categorized into different submodules that can be imported separately.
\\nThe modules are:
\\nis
def
assert
alias
math
get
Any or all modules can be imported the usual way:
\\n// Import as \\"t4t\\"\\n#import \\"@preview/t4t:0.3.2\\"\\n// Import all modules\\n#import \\"@preview/t4t:0.3.2\\": *\\n// Import specific modules\\n#import \\"@preview/t4t:0.3.2\\": is, def\\n
\\nIn general, the main value is passed last to the utility functions. #def.if-none()
, for example, takes the default value first and the value to test second. This is somewhat counterintuitive at first, but allows the use of .with()
to generate derivative functions:
#let is-foo = eq.with(\\"foo\\")\\n
\\n#import \\"@preview/t4t:0.3.2\\": is\\n
\\nThese functions provide shortcuts to common tests like #is.eq()
. Some of these are not shorter as writing pure Typst code (e.g. a == b
), but can easily be used in .any()
or .find()
calls:
// check all values for none\\nif some-array.any(is-none) {\\n...\\n}\\n\\n// find first not none value\\nlet x = (none, none, 5, none).find(is.not-none)\\n\\n// find position of a value\\nlet pos-bar = args.pos().position(is.eq.with(\\"|\\"))\\n
\\nThere are two exceptions: is-none
and is-auto
. Since keywords can\'t be used as function names, the is
module can\'t define a function to do is.none()
. Therefore the methods is-none
and is-auto
are provided in the base module of t4t
:
#import \\"@preview/t4t:0.3.2\\": is-none, is-auto\\n
\\nThe is
submodule still has these tests, but under different names (is.n
and is.non
for none
and is.a
and is.aut
for auto
).
#is.neq( test )
: Creates a new test function that is true
when test
is false
. Can be used to create negations of tests like #let not-raw = is.neg(is.raw)
.
#is.eq( a, b )
: Tests if values a
and b
are equal.
#is.neq( a, b )
: Tests if values a
and b
are not equal.
#is.n( ..values )
: Tests if any of the passed values
is none
.
#is.non( ..values )
: Alias for is.n
.
#is.not-none( ..values )
: Tests if all of the passed values
are not none
.
#is.not-n( ..values )
: Alias for is.not-none
.
#is.a( ..values )
: Tests if any of the passed values
is auto
.
#is.aut( ..values )
: Alias for is-a
.
#is.not-auto( ..values )
: Tests if all of the passed values
are not auto
.
#is.not-a( ..values )
: Alias for is.not-auto
.
#is.empty( value )
: Tests if value
is empty. A value is considered empty if it is an empty array, dictionary or string or none
otherwise.
#is.not-empty( value )
: Tests if value
is not empty.
#is.any( ..compare, value )
: Tests if value
is equal to any one of the other passed-in values.
#is.not-any( ..compare, value)
: Tests if value
is not equal to any one of the other passed-in values.
#is.has( ..keys, value )
: Tests if value
contains all the passed keys
. Either as keys in a dictionary or elements in an array. If value
is neither of those types, false
is returned.
#is.type( t, value )
: Tests if value
is of type t
.
#is.dict( value )
: Tests if value
is a dictionary.
#is.arr( value )
: Tests if value
is an array.
#is.content( value )
: Tests if value
is of type content.
#is.color( value )
: Tests if value
is a color.
#is.stroke( value )
: Tests if value
is a stroke.
#is.loc( value )
: Tests if value
is a location.
#is.bool( value )
: Tests if value
is a boolean.
#is.str( value )
: Tests if value
is a string.
#is.int( value )
: Tests if value
is an integer.
#is.float( value )
: Tests if value
is a float.
#is.num( value )
: Tests if value
is a numeric value (integer
or float
).
#is.frac( value )
: Tests if value
is a fraction.
#is.length( value )
: Tests if value
is a length.
#is.rlength( value )
: Tests if value
is a relative length.
#is.ratio( value )
: Tests if value
is a ratio.
#is.align( value )
: Tests if value
is an alignment.
#is.align2d( value )
: Tests if value
is a 2d alignment.
#is.func( value )
: Tests if value
is a function.
#is.any-type( ..types, value )
: Tests if value
has any of the passed-in types.
#is.same-type( ..values )
: Tests if all passed-in values have the same type.
#is.all-of-type( t, ..values )
: Tests if all of the passed-in values have the type t
.
#is.none-of-type( t, ..values )
: Tests if none of the passed-in values has the type t
.
#is.one-not-none( ..values )
: Checks, if at least one value in values
is not equal to none
. Useful for checking multiple optional arguments for a valid value: #if is.one-not-none(..args.pos()) [ #args.pos().find(is.not-none) ]
#is.elem( func, value )
: Tests if value
is a content element with value.func() == func
. If func
is a string, value
will be compared to repr(value.func())
instead.
Both of these effectively do the same:
\\n#is.elem(raw, some_content)\\n#is.elem(\\"raw\\", some_content)\\n
\\n#is.sequence( value )
: Tests if value
is a sequence of content.
#is.raw( value )
: Tests if value
is a raw element.
#is.table( value )
: Tests if value
is a table element.
#is.list( value )
: Tests if value
is a list element.
#is.enum( value )
: Tests if value
is an enum element.
#is.terms( value )
: Tests if value
is a terms element.
#is.cols( value )
: Tests if value
is a columns element.
#is.grid( value )
: Tests if value
is a grid element.
#is.stack( value )
: Tests if value
is a stack element.
#is.label( value )
: Tests if value
is of type label
.
#import \\"@preview/t4t:0.3.2\\": def\\n
\\nThese functions perform a test to decide if a given value
is invalid. If the test passes, the default
is returned, the value
otherwise.
Almost all functions support an optional do
argument, to be set to a function of one argument, that will be applied to the value if the test fails. For example:
// Sets date to a datetime from an optional\\n// string argument in the format \\"YYYY-MM-DD\\"\\n#let date = def.if-none(\\ndatetime.today(), // default\\npassed_date, // passed-in argument\\ndo: (d) >= {// post-processor\\nd = d.split(\\"-\\")\\ndatetime(year=d[0], month=d[1], day=d[2])\\n}\\n)\\n
\\n#def.if-true( test, default, do:none, value )
: Returns default
if test
is true
, value
otherwise.#def.if-false( test, default, do:none, value )
: Returns default
if test
is false
, value
otherwise.#def.if-none( default, do:none, value )
: Returns default
if value
is none
, value
otherwise.#def.if-auto( default, do:none, value )
: Returns default
if value
is auto
, value
otherwise.#def.if-any( ..compare, default, do:none, value )
: Returns default
if value
is equal to any of the passed-in values, value
otherwise. (#def.if-any(none, auto, 1pt, width)
)#def.if-not-any( ..compare, default, do:none, value )
: Returns default
if value
is not equal to any of the passed-in values, value
otherwise. (#def.if-not-any(left, right, top, bottom, position)
)#def.if-empty( default, do:none, value )
: Returns default
if value
is empty, value
otherwise.#def.as-arr( ..values )
: Always returns an array containing all values
. Any arrays in values
will be flattened into the result. This is useful for arguments, that can have one element or an array of elements: #def.as-arr(author).join(\\", \\")
.#import \\"@preview/t4t:0.3.2\\": assert\\n
\\nThis submodule overloads the default assert
function and provides more asserts to quickly check if given values are valid. All functions use assert
in the background.
Since a module in Typst is not callable, the assert
function is now available as assert.that()
. assert.eq
and assert.ne
work as expected.
All assert functions take an optional argument message
to set the error message shown if the assert fails.
#assert.that( test )
: Asserts that the passed test
is true
.
#assert.that-not( test )
: Asserts that the passed test
is false
.
#assert.eq( a, b )
: Asserts that a
is equal to b
.
#assert.ne( a, b )
: Asserts that a
is not equal to b
.
#assert.neq( a, b )
: Alias for assert.ne
.
#assert.not-none( value )
: Asserts that value
is not equal to none
.
#assert.any( ..values, value )
: Asserts that value
is one of the passed values
.
#assert.not-any( ..values, value )
: Asserts that value
is not one of the passed values
.
#assert.any-type( ..types, value )
: Asserts that the type of value
is one of the passed types
.
#assert.not-any-type( ..types, value )
: Asserts that the type of value
is not one of the passed types
.
#assert.all-of-type( t, ..values )
: Asserts that the type of all passed values
is equal to t
.
#assert.none-of-type( t, ..values )
: Asserts that the type of all passed values
is not equal to t
.
#assert.not-empty( value )
: Asserts that value
is not empty.
#assert.new( test )
: Creates a new assert function that uses the passed test
. test
is a function with signature (any) => boolean
. This is a quick way to create an assertion from any of the is
functions:
#let assert-foo = assert.new(is.eq.with(\\"foo\\"))\\n\\n#let assert-length = assert.new(is.length)\\n
\\n#import \\"@preview/t4t:0.3.2\\": get\\n
\\nThis submodule is a collection of functions, that mostly deal with content elements and get some information from them. Though some handle other types like dictionaries.
\\n#get.dict( ..values )
: Create a new dictionary from the passed values
. All named arguments are stored in the new dictionary as is. All positional arguments are grouped in key-value pairs and inserted into the dictionary:
#get.dict(\\"a\\", 1, \\"b\\", 2, \\"c\\", d:4, e:5)\\n\\n// (a:1, b:2, c:none, d:4, e:5)\\n
\\n#get.dict-merge( ..dicts )
: Recursively merges the passed-in dictionaries:
#get.dict-merge(\\n(a: 1),\\n(a: (one: 1, two:2)),\\n(a: (two: 4, three:3))\\n)\\n\\n// (a:(one:1, two:4, three:3))\\n
\\n#get.args( args, prefix: \\"\\" )
: Creates a function to extract values from an argument sink args
.
The resulting function takes any number of positional and named arguments and creates a dictionary with values from args.named()
. Positional arguments are present in the result if they are present in args.named()
. Named arguments are always present, either with their value from args.named()
or with the provided value.
A prefix
can be specified, to extract only specific arguments. The resulting dictionary will have all keys with the prefix removed, though.
#let my-func( ..options, title ) = block(\\n..get.args(options)(\\n\\"spacing\\", \\"above\\", \\"below\\",\\nwidth:100%\\n)\\n)[\\n#text(..get.args(options, prefix:\\"text-\\")(\\nfill:black, size:0.8em\\n), title)\\n]\\n\\n#my-func(\\nwidth: 50%,\\ntext-fill: red, text-size: 1.2em\\n)[#lorem(5)]\\n
\\n#get.text( element, sep: \\"\\" )
: Recursively extracts the text content of a content element.\\nIf present, all child elements are converted to text and joined with sep
.
#get.stroke-paint( stroke, default: black )
: Returns the color of stroke
. If no color information is available, default
is used. (Deprecated, use stroke.paint
instead.)
#get.stroke-thickness( stroke, default: 1pt )
: Returns the thickness of stroke
. If no thickness information is available, default
is used. (Deprecated, use stroke.thickness
instead.)
#get.stroke-dict( stroke, ..overrides )
: Creates a dictionary with the keys necessary for a stroke. The returned dictionary is guaranteed to have the keys paint
, thickness
, dash
, cap
and join
.
If stroke
is a dictionary itself, all key-value pairs are copied to the resulting stroke. Any named arguments in overrides
will override the previous value.
#get.inset-at( direction, inset, default: 0pt )
: Returns the inset (or outset) in a given direction
, ascertained from inset
.
#get.inset-dict( inset, ..overrides )
: Creates a dictionary usable as an inset (or outset) argument.
The resulting dictionary is guaranteed to have the keys top
, left
, bottom
and right
.
If inset
is a dictionary itself, all key-value pairs are copied to the resulting stroke. Any named arguments in overrides
will override the previous value.
#get.x-align( align, default:left )
: Returns the alignment along the x-axis from the passed-in align
value. If none is present, default
is returned. (Deprecated, use align.x
instead.)
#get.x-align(top + center) // center\\n
\\n#get.y-align( align, default:top )
: Returns the alignment along the y-axis from the passed-in align
value. If none is present, default
is returned. (Deprecated, use align.y
instead.)
#import \\"@preview/t4t:0.3.2\\": math\\n
\\nSome functions to complement the native calc
module.
#math.minmax( a, b )
: Returns an array with the minimum of a
and b
as the first element and the maximum as the second:
#let (min, max) = math.minmax(a, b)\\n
\\n#math.clamp( min, max, value )
: Clamps a value between min
and max
. In contrast to calc.clamp()
this function works for other values than numbers, as long as they are comparable.
text-size = math.clamp(0.8em, 1.2em, text-size)\\n
\\n#lerp( min, max, t )
: Calculates the linear interpolation of t
between min
and max
.
#let width = math.lerp(0%, 100%, x)\\n
\\nt
should be a value between 0 and 1, but the interpolation works with other values, too. To constrain the result into the given interval, use math.clamp
:
#let width = math.lerp(0%, 100%, math.clamp(0, 1, x))\\n
\\n#map( min, max, range-min, range-max, value )
: Maps a value
from the interval [min, max]
into the interval [range-min, range-max]
:
#let text-weight = int(math.map(8pt, 16pt, 400, 800, text-size))\\n
\\n#import \\"@preview/t4t:0.3.2\\": alias\\n
\\nSome of the native Typst function as aliases, to prevent collisions with some common argument names.
\\nFor example using numbering
as an argument is not possible if the value is supposed to be passed to the numbering()
function. To still allow argument names that are in line with the common Typst names (like numbering
, align
...), these alias functions can be used:
#let excercise( no, numbering: \\"1)\\" ) = [\\nExercise #alias.numbering(numbering, no)\\n]\\n
\\nThe following functions have aliases right now:
\\nnumbering
align
type
label
text
raw
table
list
enum
terms
grid
stack
columns
#type
function in Typst 0.8.0.assert
module.is.elem
(see #2).assert.has-pos
, assert.no-pos
, assert.has-named
and assert.no-named
.is.neg
function to negate a test function.alias.label
.is.label
test.def.as-arr
to create an array of the supplied values. Useful if an argument can be both a single value or an array.assert.that-not
for negated assertions.is.one-not-none
test to check multiple values, if at least one is not none.do
argument to all functions in def
.is.elem
(see #1).\\nis.sequence
test.get.stroke-paint
, get.stroke-thickness
, get.x-align
and get.y-align
in favor of new Typst 0.7.0 features.GViz is a typst plugin that can render graphviz graphs.
\\nIt uses https://codeberg.org/Sekoia/layout as a backend, which means it can currently only render to SVG, and mostly supports basic features.
\\nImport it like any other plugin: #import \\"@preview/gviz:0.1.0\\": *
.
#import \\"@preview/gviz:0.1.0\\": *\\n\\n#show raw.where(lang: \\"dot-render\\"): it => render-image(it.text)\\n\\n```dot-render\\ndigraph mygraph {\\n node [shape=box];\\n A -> B;\\n B -> C;\\n B -> D;\\n C -> E;\\n D -> E;\\n E -> F;\\n A -> F [label=\\"one\\"];\\n A -> F [label=\\"two\\"];\\n A -> F [label=\\"three\\"];\\n A -> F [label=\\"four\\"];\\n A -> F [label=\\"five\\"];\\n}```\\n\\n#let my-graph = \\"digraph {A -> B}\\"\\n#render-image(my-graph)\\n\\nSVG:\\n#raw(render(my-graph), block: true, lang: \\"svg\\")\\n
\\nRenders a graph in dot language and returns SVG code for it.
\\nParameters:
\\nReturns: string
\\nRenders a graph in dot language and returns an SVG image of it. Uses the same parameters as image.decode.
\\nParameters:
\\nReturns: content
\\n","description":"GViz is a typst plugin that can render graphviz graphs. It uses https://codeberg.org/Sekoia/layout as a backend, which means it can currently only render to SVG, and mostly supports basic features.\\n\\nImport it like any other plugin: #import \\"@preview/gviz:0.1.0\\": *.\\n\\nUsage\\n#import…","guid":"https://typst.app/universe/package/gviz","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-09-15T10:49:26.891Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"gloss-awe (0.0.5) | Awesome Glossary for Typst.","url":"https://typst.app/universe/package/gloss-awe","content":"Automatically create a glossary in typst.
\\nThis typst component creates a glossary page from a given pool of potential glossary\\nentries using only those entries, that are marked with the gls
or gls-add
functions in\\nthe document.
⚠️ Typst is in beta and evolving, and this package evolves with it. As a result, no\\nbackward compatibility is guaranteed yet. Also, the package itself is under development\\nand fine-tuning.
\\nTo include a term into the glossary, it can be marked with the gls
function. The\\nsimplest form is like this:
This is how to mark something for the glossary in #gls[Typst].\\n
\\nThe function will render as defined with the specified show rule (see below!).
\\nTo control, how the markers are rendered in the document, a show rule has to be defined.\\nIt usually looks like the following:
\\n// marker display : this rule makes the glossary marker in the document visible.\\n#show figure.where(kind: \\"jkrb_glossary\\"): it => {it.body}\\n
\\nIt is also possible to hide entries (temporarily) from the generated glossary page without\\nremoving any markers for them from the document.
\\nThe following sample will hide the entries for \\"Amaranth\\" and \\"Butterscotch\\" from the\\nglossary, even if it is marked with gls[...]
or gls-add[...]
somewhere in the\\ndocument.
#let hidden-entries = (\\n \\"Amaranth\\",\\n \\"Butterscotch\\"\\n )\\n\\n #make-glossary(glossary-pool, excluded: hidden-entries)\\n
\\nA \\"pool of entries\\" is a typst dictionary. It can be read from a file or may be the result\\nof other operations.
\\nOne or more pool(s) are then given to the make-glossary()
function. This will create a\\nglossary page of all referenced entries. If given more than one pool, the order pools are\\nsearched in the order they are given to the method. The first match wins. This can be used\\nto have a global pool to be used in different documents, and another one for local usage\\nonly.
The pool consists of a dictionary of definition entries. The key of an entry is the term.\\nNote, that it is case-sensitive. Each entry itself is also a dictionary, and its main key\\nis description
. This is the content for the term. There may be other keys in an entry in\\nthe future. For now, it supports:
An entry in the pool for the term \\"Engine\\" file may look like this:
\\n Engine: (\\n description: [\\n\\n In the context of software, an engine...\\n\\n ],\\n link: [\\n\\n (1) Software engine - Wikipedia.\\n https://en.wikipedia.org/wiki/Software_engine\\n (13.5.2023).\\n\\n ]\\n ),\\n
\\nIf the document marks a term that is not contained in the pool, an entry will be generated\\nanyway, but it will be visually marked as missing. This is convenient for the workflow,\\nwhere one can mark the desired entries while writing the document, and provide missing\\nentries later.
\\nThere is a parameter for the make-glossary()
function named missing
, where a function\\ncan be provided to format or even suppress the missing entries.
To create the glossary page, provide the pool of potential entries to the make-glossary\\nfunction. The following listing shows a complete sample document with a glossary. The\\nsample glossary pool is contained in the main document as well:
\\n #import \\"@preview/gloss-awe:0.0.5\\": *\\n\\n // Text settings\\n #set text(font: (\\"Arial\\", \\"Trebuchet MS\\"), size: 12pt)\\n\\n // Defining the Glossary Pool with definitions.\\n #let glossary-pool = (\\n Cloud: (\\n description: [\\n\\n Cloud computing is a model where computer resources are made available\\n over the internet. Such resources can be assigned on demand in a very short\\n time, and only as long as they are required by the user.\\n\\n ]\\n ),\\n\\n Marker: (\\n description: [\\n\\n A Marker in `gloss-awe` is a typst function to mark a word or phrase to appear\\n in the documents glossary. The marker is also linked to the glossary section\\n by referencing the label `<Glossary>`.\\n\\n ]\\n ),\\n\\n Glossary: (\\n description: [\\n\\n A glossary is a list of terms and their definitions that are specific to a\\n particular subject or field. It is used to define the intended meaning of\\n terms used in a document and to agree on a common definition of those terms. A\\n well-defined glossary can be very helpful in documents where very specific\\n meanings of certain terms are used.\\n\\n ]\\n ),\\n\\n \\"Glossary Pool\\": (\\n description: [\\n\\n A glossary pool is a collection of glossary entries. An automated tool can\\n pull needed definitions from this pool to create the glossary pages for a\\n specific context.\\n\\n ]\\n ),\\n\\n REST: (\\n description: [\\n\\n Representational State Transfer (abgekürzt REST) ist ein Paradigma für die\\n Softwarearchitektur von verteilten Systemen, insbesondere für Webservices.\\n REST ist eine Abstraktion der Struktur und des Verhaltens des World Wide\\n Web. REST hat das Ziel, einen Architekturstil zu schaffen, der den\\n Anforderungen des modernen Web besser genügt.\\n\\n ]\\n ),\\n\\n XML: (\\n description: [\\n\\n XML stands for `\'eXtensible Markup Language\'`.\\n\\n ],\\n link: [https://www.w3.org/XML]\\n ),\\n )\\n\\n // Defining, how marked glossary entries in the document appear\\n #show figure.where(kind: \\"jkrb_glossary\\"): it => {it.body}\\n\\n // This alternate rule, creates links to the glossary for marked entries.\\n // #show figure.where(kind: \\"jkrb_glossary\\"): it => [#link(<Glossar>)[#it.body]]\\n\\n = My Sample Document with `gloss-awe`\\n\\n In this document the usage of the `gloss-awe` package is demonstrated to create a glossary\\n with the help of a simple and small sample glossary pool. We have defined the pool in a\\n dictionary named #gls[Glossary Pool] above. It contains the definitions the `gloss-awe`\\n can use to build the glossary in the #gls[Glossary] section of this document. The pool\\n could also come from external files, like #gls[JSON] or #gls[XML] or other sources. Only\\n those definitions are shown in the glossary, that are marked in this document with one of\\n the #gls(entry: \\"Marker\\")[marker] functions `gloss-awe` provides.\\n\\n If a Word is marked, that is not in the Glossary Pool, it gets a special markup in the\\n resulting glossary, making it easy for the Author to spot the missing information an\\n providing a definition. In this sample, there is no definition for \\"JSON\\" provided,\\n resulting in an Entry with a red remark \\"#text(fill: red)[No~glossary~entry]\\".\\n\\n There is also a way to include Entries in the glossary for Words that are not contained in\\n the documents text:\\n\\n #gls-add(\\"Cloud\\")\\n #gls-add(\\"REST\\")\\n\\n\\n = Glossary <Glossary>\\n\\n This section contains the generated Glossary, in a nice two-column-layout. It also bears a\\n label, to enable the linking from marked words to the glossary.\\n\\n #line(length: 100%)\\n #set text(font: (\\"Arial\\", \\"Trebuchet MS\\"), size: 10pt)\\n #columns(2)[\\n #make-glossary(glossary-pool)\\n ]\\n\\n
\\nMore usage samples are shown in the document sample-usage.typ
on\\ngloss-awe´s GitHub.
A more complex sample PDF is available there as well.
\\n\\nfigure.caption
in typst (commit: 976abdf ).glossary.typ
to gloss-awe.typ
to match package.gls-add[...]
function for entries that are not in the document.A package to create callouts in typst, inspired by the Obsidan callouts.
\\nUse preset callouts, or create your own!
\\nImport the package
\\n#import \\"@preview/babble-bubbles:0.1.0\\": *\\n
\\nOr grab it locally and use:
\\n#import \\"@local/babble-bubbles:0.1.0\\": *\\n
\\nHere you can find a list of presets and an example usage of each.\\nYou can customise them with the same parameters as the callout
function. See the Custom callouts
for more details.
#info[This is information]\\n\\n#success[I\'m making a note here: huge success]\\n\\n#check[This is checked!]\\n\\n#warning[First warning...]\\n\\n#note[My incredibly useful note]\\n\\n#question[Question?]\\n\\n#example[An example make things interesting]\\n\\n#quote[To be or not to be]\\n
\\ncallout
Create a default callout.\\nTweak the parameters to create your own!
\\ncallout(\\n body,\\n title: \\"Callout\\",\\n fill: blue,\\n title-color: white,\\n body-color: black,\\n icon: none)\\n
\\nYou can create aliases to more easily handle your\\nnewly create callouts or customise presets by using with.
\\n#let mycallout = callout.with(title: \\"My callout\\")\\n\\n#mycallout[Hey this is my custom callout!]\\n
\\n","description":"A package to create callouts in typst, inspired by the Obsidan callouts. Use preset callouts, or create your own!\\n\\nUsage\\n\\nImport the package\\n\\n#import \\"@preview/babble-bubbles:0.1.0\\": *\\n\\n\\nOr grab it locally and use:\\n\\n#import \\"@local/babble-bubbles:0.1.0\\": *\\n\\nPresets\\n\\nHere you can find…","guid":"https://typst.app/universe/package/babble-bubbles","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-09-11T13:56:59.772Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/babble-bubbles/0.1.0/examples/callouts.png","type":"photo","width":1280,"height":1468}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"statastic (1.0.0) | A library to calculate statistics for numerical data","url":"https://typst.app/universe/package/statastic","content":"A library to calculate statistics for numerical data in typst.
\\nStatastic
is a Typst library designed to provide various statistical functions for numerical data. It offers functionalities like extracting specific columns from datasets, converting array elements to different data types, and computing various statistical measures such as average, median, mode, variance, standard deviation, and percentiles.
To use the package you can import it through this command import \\"@preview/statastical:1.0.0\\": *
(as soon as the pull request ist accepted). The documentation is found in the docs.pdf
in the development repo
This project is licensed under the Unlicense.
\\n","description":"A library to calculate statistics for numerical data in typst. Description\\n\\nStatastic is a Typst library designed to provide various statistical functions for numerical data. It offers functionalities like extracting specific columns from datasets, converting array elements to…","guid":"https://typst.app/universe/package/statastic","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-09-03T09:05:45.776Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"polylux (0.3.1) | Presentation slides creation with Typst","url":"https://typst.app/universe/package/polylux","content":"This is a package for creating presentation slides in Typst.\\nRead the book to learn all\\nabout it and click here\\nto see what\'s new!
\\nIf you like it, consider giving a star on GitHub!
\\n\\nFor the bare-bones, do-it-yourself experience, all you need is:
\\n// Get Polylux from the official package repository\\n#import \\"@preview/polylux:0.3.1\\": *\\n\\n// Make the paper dimensions fit for a presentation and the text larger\\n#set page(paper: \\"presentation-16-9\\")\\n#set text(size: 25pt)\\n\\n// Use #polylux-slide to create a slide and style it using your favourite Typst functions\\n#polylux-slide[\\n #align(horizon + center)[\\n = Very minimalist slides\\n\\n A lazy author\\n\\n July 23, 2023\\n ]\\n]\\n\\n#polylux-slide[\\n == First slide\\n\\n Some static text on this slide.\\n]\\n\\n#polylux-slide[\\n == This slide changes!\\n\\n You can always see this.\\n // Make use of features like #uncover, #only, and others to create dynamic content\\n #uncover(2)[But this appears later!]\\n]\\n
\\nThis code produces these PDF pages:\\n
From there, you can either start creatively adapting the looks to your likings\\nor you can use one of the provided themes.\\nThe simplest one of them is called simple
(what a coincidence!).\\nIt is still very unintrusive but gives you some sensible defaults:
#import \\"@preview/polylux:0.3.1\\": *\\n\\n#import themes.simple: *\\n\\n#set text(font: \\"Inria Sans\\")\\n\\n#show: simple-theme.with(\\n footer: [Simple slides],\\n)\\n\\n#title-slide[\\n = Keep it simple!\\n #v(2em)\\n\\n Alpha #footnote[Uni Augsburg] #h(1em)\\n Bravo #footnote[Uni Bayreuth] #h(1em)\\n Charlie #footnote[Uni Chemnitz] #h(1em)\\n\\n July 23\\n]\\n\\n#slide[\\n == First slide\\n\\n #lorem(20)\\n]\\n\\n#focus-slide[\\n _Focus!_\\n\\n This is very important.\\n]\\n\\n#centered-slide[\\n = Let\'s start a new section!\\n]\\n\\n#slide[\\n == Dynamic slide\\n Did you know that...\\n\\n #pause\\n ...you can see the current section at the top of the slide?\\n]\\n
\\nThis time, we obtain these PDF pages:\\n
As you can see, a theme can introduce its own types of slides (here: title-slide
,\\nslide
, focus-slide
, centered-slide
) to let you quickly switch between\\ndifferent layouts.\\nThe book\\nhas more infos\\non how to use (and create your own) themes.
For dynamic content, Polylux also provides a convenient API for complex\\noverlays.
\\nIf you use pdfpc to display your slides, you can rely\\non Polylux\' support for it\\nand create speaker notes, hide slides, configure the timer and more!
\\nVisit the\\nbook\\nfor more details or take a look at the\\ndemo PDF\\nwhere you can see the features of this template in action.
\\n⚠ This package is under active development and there are no backwards\\ncompatibility guarantees!
\\nThank you to...
\\nuniversity
thememetropolis
themeclean
themepolylux2pdfpc
AUR packageThis package is for constructing proof trees in the style of natural deduction or the sequent calculus, for typst
0.7.0
. Please do open issues for bugs etc :)
Features:
\\n¹ The placement of labels is currently very primitive, and requires much user intervention.
\\n² Options are quite limited.
\\nThe user interface is inspired by bussproof\'s; a tree is constructed by a sequence of \'lines\' that state their number of premises.\\nsrc/prooftrees.typ
contains the documentation and the main functions needed.
The code for some example trees can be seen in examples/prooftree_test.typ
.
A single inference would be:
\\n#import \\"@preview/prooftrees:0.1.0\\"\\n\\n#prooftree.tree(\\n prooftree.axi[$A => A$],\\n prooftree.uni[$A => A, B$]\\n)\\n
\\nA more interesting example:
\\n#import \\"@preview/prooftrees:0.1.0\\"\\n\\n#prooftree.tree(\\n prooftree.axi[$B => B$],\\n prooftree.uni[$B => B, A$],\\n prooftree.uni[$B => A, B$],\\n prooftree.axi[$A => A$],\\n prooftree.uni[$A => A, B$],\\n prooftree.bin[$B => A, B$]\\n)\\n
\\nAn n-ary inference can be made:
\\n#import \\"@preview/prooftrees:0.1.0\\"\\n\\n#prooftrees.tree(\\n prooftrees.axi(pad(bottom: 2pt, [$P_1$])),\\n prooftrees.axi(pad(bottom: 2pt, [$P_2$])),\\n prooftrees.axi(pad(bottom: 2pt, [$P_3$])),\\n prooftrees.axi(pad(bottom: 2pt, [$P_4$])),\\n prooftrees.axi(pad(bottom: 2pt, [$P_5$])),\\n prooftrees.axi(pad(bottom: 2pt, [$P_6$])),\\n prooftrees.nary(6)[$C$],\\n)\\n
\\nThe boundaries of blocks containing math do not expand enough for sub/pscripts; I think this is a typst issue.\\nShort-term fix: add manual vspace or padding in the cell.
\\nThe placement of the line and conclusion is calculated using measure
on the premises and labels, and doing geometric arithmetic with these values.
tbl.typ
This is a library for Typst built upon Pg Biel\'s fabulous\\ntablex
library.
It allows the creation of complex tables in Typst using a compact syntax based\\non the tbl
preprocessor for the traditional UNIX TROFF typesetting system.\\nThere are also some novel features that are not currently offered by Typst\\nitself or tablex
, namely:
decimalpoint
region option and\\nN
-classified columns)e
column modifier)w
column modifier)z
column\\nmodifier)mode: \\"math\\"
region option)Many other features exist to condense common configurations to a concise syntax.
\\nFor example:
\\n#import \\"@preview/tbl:0.0.4\\"\\n#show: tbl.template.with(box: true, tab: \\"|\\")\\n\\n```tbl\\n R | L\\n R N.\\nsoftware|version\\n_\\n AFL|2.39b\\n Mutt|1.8.0\\n Ruby|1.8.7.374\\nTeX Live|2015\\n```\\n
\\nMany other examples and copious documentation are provided in the\\nREADME.pdf
file.
The source repository also includes a\\ntest suite based on those examples, which can be ran using the GNU make
\\ncommand. See make help
for details.
This is a package inspired by the LaTeX algorithmicx
package\\nfor Typst. It\'s useful for writing pseudocode and typesetting it all nicely.
Example:
\\n#import \\"@preview/algorithmic:0.1.0\\"\\n#import algorithmic: algorithm\\n\\n#algorithm({\\n import algorithmic: *\\n Function(\\"Binary-Search\\", args: (\\"A\\", \\"n\\", \\"v\\"), {\\n Cmt[Initialize the search range]\\n Assign[$l$][$1$]\\n Assign[$r$][$n$]\\n State[]\\n While(cond: $l <= r$, {\\n Assign([mid], FnI[floor][$(l + r)/2$])\\n If(cond: $A [\\"mid\\"] < v$, {\\n Assign[$l$][$m + 1$]\\n })\\n ElsIf(cond: [$A [\\"mid\\"] > v$], {\\n Assign[$r$][$m - 1$]\\n })\\n Else({\\n Return[$m$]\\n })\\n })\\n Return[*null*]\\n })\\n})\\n
\\nThis DSL is implemented using the same trick as CeTZ uses: a code block of\\narrays gets those arrays joined together.
\\nCurrently this library is not really customizable. Please vendor it and hack it\\nup as needed then file an issue for the customization option you\'re missing.
\\nStatement-level contexts in algorithmic
generally accept the type body
in\\nthe following:
body = (ast|content)[] | ast | content\\nast = (change_indent: int, body: body)\\n
\\nInline functions will generate plain content.
\\nalgorithmic(..bits)
Takes one or more lists of ast
and creates an algorithmic block with line\\nnumbers.
Function
/Procedure
(stmt)Defined as f(name: string|content, args: content[]?, ..body)
. Body can be one or more body
\\nvalues.
If
/ElseIf
/Else
/For
/While
(stmt)Defined as f(cond: string|content, ..body)
. Body can be one or more body
\\nvalues.
Generates an indented block with the body, and the specified cond
between the\\ntwo keywords as condition.
Assign
(stmt)Defined as Assign(var: content, val: content)
.
Generates #var <- #val
.
CallI
(inline), Call
(stmt)Defined as f(name, args: content|content[])
.
Calls a function with the function name styled in smallcaps and the args joined by\\ncommas.
\\nCmt
(stmt)Defined as Cmt(body: content)
.
Makes a line comment.
\\nFnI
(inline), Fn
(stmt)Defined as f(name, args: content|content[])
.
Calls a function with the function name styled in bold and the args joined by\\ncommas.
\\nIc
(inline)Defined as Ic(body: content) -> content
.
Makes an inline comment.
\\nReturn
(stmt)Defined as Return(arg: content)
.
Generates return #arg
.
State
(stmt)Defined as State(body: content)
.
Turns any content into a line.
\\n","description":"This is a package inspired by the LaTeX algorithmicx package for Typst. It\'s useful for writing pseudocode and typesetting it all nicely. Example:\\n\\n#import \\"@preview/algorithmic:0.1.0\\"\\n#import algorithmic: algorithm\\n\\n#algorithm({\\n import algorithmic: *\\n Function(\\"Binary-Search…","guid":"https://typst.app/universe/package/algorithmic","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-08-19T17:09:44.211Z","media":[{"url":"https://raw.githubusercontent.com/typst/packages/main/packages/preview/algorithmic/0.1.0/docs/assets/demo-rendered.png","type":"photo","width":998,"height":999}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"diverential (0.2.0) | Format differentials conveniently.","url":"https://typst.app/universe/package/diverential","content":"diverential
is a Typst package simplifying the typesetting of differentials. It is the equivalent to LaTeX\'s diffcoeff
, though not as mature.
diverential
allows normal, partial, compact, and separated derivatives with smart degree calculations.
#import \\"@preview/diverential:0.2.0\\": *\\n\\n$ dv(f, x, deg: 2, eval: 0) $\\n$ dvp(f, x, y, eval: 0, evalsym: \\"[\\") $\\n$ dvpc(f, x) $\\n$ dvps(f, #([x], 2), #([y], [n]), #([z], [m]), eval: 0) $\\n
\\ndv
dv
is an ordinary derivative. It takes the function as its first argument and the variable as its second one. A degree can be specified with deg
. The derivate can be specified to be evaluated at a point with eval
, the brackets of which can be changed with evalsym
. space
influences the space between derivative and evaluation bracket. Unless defined otherwise, no space is set by default, except for |
, where a small gap is introduced.
dvs
Same as dv
, but separates the function from the derivative.
\\nExample:\\n$$ \\\\frac{\\\\mathrm{d}}{\\\\mathrm{d}x} f $$
dvc
Same as dv
, but uses a compact derivative.
\\nExample:\\n$$ \\\\mathrm{d}_x f $$
dvp
dv
is a partial derivative. It takes the function as its first argument and the variable as the rest. For information on eval
, evalsym
, and space
, read the description of dv
.
\\nThe variable can be one of these options:
x
x, y
(content, integer)
), e.g. x, #([y], 2)
\\nThe degree is smartly calculated: If all degrees of the variables are integers, the total degree is their sum. If some are content, the integer ones are summed (arithmetically) up and added to the visual sum of the content degrees. Example: #([x], n), #([y], 2), z
→ $\\\\frac{\\\\partial^{n+3}}{\\\\partial x^n,\\\\partial y^2,\\\\partial z}$deg
manually is always possible and might be required in more complicated cases.dvps
Same as dvp
, but separates the function from the derivative.
\\nExample:\\n$$ \\\\frac{\\\\partial}{\\\\partial x} f $$
dvpc
Same as dvp
, but uses a compact derivative.
\\nNote: If supplying multiple variables, deg
is ignored.
\\nExample:\\n$$ \\\\partial_x f $$
Extended numbering patterns using the CSS Counter Styles specification, along\\nwith a number of Ready-made Counter Styles.
\\n// numberingx is expected to be imported with the syntax creating a named module\\n#import \\"@preview/numberingx:0.0.1\\"\\n\\n// Use full-width roman numerals for titles, and lowercase ukrainian letters\\n#set heading(numbering: numberingx.formatter(\\n \\"{fullwidth-upper-roman}.{fullwidth-lower-roman}.{lower-ukrainian}\\"\\n))\\n
\\nnumberingx\'s patterns are similiar to typst\'s numbering patterns and use the\\nsame notion of fragments with a prefix and a final suffix. The main difference\\nis that it doesn\'t use special characters and all numbering styles must be\\nwritten within braces. To insert a literal brace, you can double it.
\\nA list of patterns can be found in the Ready-made Counter Styles document.\\nAdditionally, numberingx allows typst\'s numbering characters to be used in\\npatterns. This way, \\"{upper-roman}.{decimal})\\"
can be shortened to\\n\\"{I}.{1})\\"
.
numberingx exposes two functions, format
and formatter
.
format(fmt, styles: (:), ..nums)
This function uses the same api as typst\'s numbering()
and takes the pattern\\nstring as its first positional argument, and numbers as trailing arguments. An\\noptional styles
argument allows for\\nuser-defined styles.
formatter(fmt, styles: (:))
This function is little more than a shorter version of format.with(..)
. It\\ntakes a pattern string and an optional styles
argument, and return the\\nmatching numbering functions. This is mainly intended to be used for #set
\\nrules.
Custom styles can be defined according to the CSS Counter Styles spec and\\npassed through a styles
named argument to format
and formatter
. It must be a dictionary mapping style names to style descriptions.
Note that the prefix
, suffix
, pad
, and speak-as
descriptors are not supported, nor is the extends
system.
This repository is licensed under MIT-0, which is the closest I\'m legally\\nallowed to public domain while being OSI approved.
\\n","description":"Extended numbering patterns using the CSS Counter Styles specification, along with a number of Ready-made Counter Styles. Usage\\n// numberingx is expected to be imported with the syntax creating a named module\\n#import \\"@preview/numberingx:0.0.1\\"\\n\\n// Use full-width roman numerals…","guid":"https://typst.app/universe/package/numberingx","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-07-21T12:56:30.394Z","media":null,"categories":null,"attachments":null,"extra":null,"language":null},{"title":"big-todo (0.1.0) | Package to insert clear TODOs. Optionallay with an outline.","url":"https://typst.app/universe/package/big-todo","content":"Create clearly visible TODOs in your document, and add an outline to keep track of them.
\\nImport the package
\\nimport \\"@preview/big-todo:0.1.0\\": *\\n
\\nAnd use the todo
function to create a TODO, and the put the todo_outline
somewhere to keep track of them.
= Pirates\\n\\nPirates, a term often associated with seafaring outlaws, have left an indelible mark on world history. The term conjures images of Jolly Roger flags, eye patches, and treasure chests, but the reality of piracy is more complex and varied than its romanticized image suggests. Historically, pirates were motivated by wealth, adventure, or desperation and were not confined to the seas of the Caribbean but roamed the waters of the Mediterranean, the South China Sea, and the Atlantic Ocean. Pirate societies were notorious for their flouting of societal norms, and many pirate ships operated under democratic principles, offering crew members an equal share in the spoils and voting rights on important decisions. To get a better picture, it\'s worth looking into how the social structures onboard these pirate vessels contrasted with those on merchant or navy vessels of the same era. #todo([Research and provide more _detail_ on #underline[pirate ship] governance and societal norms ])\\n\\nPirates\' influence on history extends beyond their shipboard societies, however. Many pirates played important roles in global trade, war, and politics, often acting as privateers for countries at war. At times, they acted as de facto naval forces, protecting their patron countries\' interests or disrupting those of their enemies. During the Golden Age of Piracy, roughly from 1650 to 1720, pirates were a major force in the Atlantic and the Caribbean, attacking the heavily laden ships of the Spanish Empire and others. They have also impacted popular culture, inspiring countless books, movies, and games. But their story is not finished. Modern-day piracy, especially off the coast of Somalia, has become a significant issue in international shipping.\\n\\n#todo_outline\\n
\\nThe todo
function has the follwin parameters and defaults:
| Parameter | Default | Type | Description |\\n| ------------ | ------- | ------- | ----------------------------------------------- |\\n| body
| / | Content | Content of the todo |\\n| big_text
| 40pt | Length | Size of the ! TODO !
text |\\n| small_text
| 15pt | Length | Size of the content |\\n| gap
| 2mm | Length | Gap between the ! TODO !
text and the content |
Write Chinese pinyin easily.
\\nImport the package:
\\n#import \\"@preview/easy-pinyin:0.1.0\\": pinyin, zhuyin\\n
\\nWith the pinyin
function, you can use a2
to write an ɑ́
, o3
to write an ǒ
, v4
to represent ǜ
, etc.
With zhuyin
function,you can put pinyin above the text easily, with parameters:
doc: content|string
: main charactersruby: content|string
: zhuyin charactersscale: number = 0.7
: font size scale of ruby
, default 0.7
gutter: length = 0.3em
: spacing between doc
and ruby
, default 0.3em
delimiter: string|none = none
: if not none, use this character to split doc
and ruby
into partsspacing: length|none = none
: spacing between each partsSee example bellow.
\\n汉(#pinyin[ha4n])语(#pinyin[yu3])拼(#pinyin[pi1n])音(#pinyin[yi1n])。\\n\\n#let per-char(f) = [#f(delimiter: \\"|\\")[汉|语|拼|音][ha4n|yu3|pi1n|yi1n]]\\n#let per-word(f) = [#f(delimiter: \\"|\\")[汉语|拼音][ha4nyu3|pi1nyi1n]]\\n#let all-in-one(f) = [#f[汉语拼音][ha4nyu3pi1nyi1n]]\\n#let example(f) = (per-char(f), per-word(f), all-in-one(f))\\n\\n// argument of scale and spacing\\n#let arguments = ((0.5, none), (0.7, none), (0.7, 0.1em), (1.0, none), (1.0, 0.2em))\\n\\n#table(\\n columns: (auto, auto, auto, auto),\\n align: (center + horizon, center, center, center),\\n [arguments], [per char], [per word], [all in one],\\n ..arguments.map(((scale, spacing)) => (\\n text(size: 0.7em)[#scale,#repr(spacing)], \\n ..example(zhuyin.with(scale: scale, spacing: spacing))\\n )).flatten(),\\n)\\n
\\nMIT, see License file.
\\n","description":"Write Chinese pinyin easily. Usage\\n\\nImport the package:\\n\\n#import \\"@preview/easy-pinyin:0.1.0\\": pinyin, zhuyin\\n\\n\\nWith the pinyin function, you can use a2 to write an ɑ́, o3 to write an ǒ, v4 to represent ǜ, etc.\\n\\nWith zhuyin function,you can put pinyin above the text easily, with…","guid":"https://typst.app/universe/package/easy-pinyin","author":null,"authorUrl":null,"authorAvatar":null,"publishedAt":"2023-07-06T12:23:04.838Z","media":[{"url":"https://github.com/7sDream/typst-easy-pinyin/blob/master/example.png?raw=true","type":"photo","width":2925,"height":1759}],"categories":null,"attachments":null,"extra":null,"language":null},{"title":"example (0.1.0) | An example package.","url":"https://typst.app/universe/package/example","content":"An example package demonstrating the structure of a Typst package.
\\nDisplays the text \\"This is an example!\\" when included and exports four functions\\nadd
, sub
, mul
, and div
that perform the respective mathematical\\noperations on two operands.