Skip to content

Create a Template

The simplest Oicana template consists of a typst.toml file and a Typst source file with some static content. The oicana new command scaffolds both for you in one step.

We will use the new command of the Oicana CLI to create a starter template. If you are using the online Typst editor, manually create the files and paste their content.

Terminal window
oicana new example

This creates an example/ directory with two files. Open it in your IDE with Typst support.

main.typ
#set document(date: datetime.today())
= Hello
Edit `main.typ` to design your template.

The preview of main.typ should show the heading and text.

The companion example/typst.toml is the template manifest:

typst.toml
[package]
name = "example"
version = "0.1.0"
entrypoint = "main.typ"
[tool.oicana]
manifest_version = 1

It gives our template the name example, the semantic version 0.1.0, and defines the entrypoint as main.typ. The tool.oicana section only configures the Oicana manifest version for now.

To check that the manifest is well-formed, run oicana validate in the template directory. It will report any issues with typst.toml before you try to package or compile the template.

To compile the template through Oicana integrations, like shown in later chapters of this guide, it has to be packaged. Navigate into the template directory in a terminal and execute oicana pack. This will create a file called example-0.1.0.zip.

Complete code at the end of this chapter
main.typ
#set document(date: datetime.today())
= Hello
Edit `main.typ` to design your template.
typst.toml
[package]
name = "example"
version = "0.1.0"
entrypoint = "main.typ"
[tool.oicana]
manifest_version = 1