Qooklet is a Typst template for scientific notes and booklet-style documents. It provides chapter pages, front matter, localized labels, equation and figure numbering, theorem environments, CSV tables, and styled code blocks with a small set of configurable TOML files.
- Note mode and booklet mode:
- note mode is the default and is useful for single chapters or lecture notes;
- booklet mode is activated after
cover()is called and enables book-like front matter, part pages, chapter pages, and appendix pages.
- Book structure helpers:
cover(),epigraph(),preface(),contents(), andpart-page();chapter-style()for normal chapters;appendix-style()for appendices.
- Automatic numbering:
- equations are numbered by chapter or appendix;
- figures and tables use localized supplements;
- references are formatted through the template style.
- Scientific writing utilities:
- Configurable labels, fonts, page sizes, spacing, and language through TOML.
#import "@preview/qooklet:0.6.2": *Clone this repository into Typst's local package directory:
- Linux:
$XDG_DATA_HOME/typst/packages/local~/.local/share/typst/packages/local
- macOS:
~/Library/Application Support/typst/packages/local - Windows:
%APPDATA%/typst/packages/local
Then import the local package:
#import "@local/qooklet:0.1.0": *The local package keeps the version at 0.1.0 for development convenience.
Use note mode when you only need a chapter-style document without cover pages or front matter.
#import "@preview/qooklet:0.6.2": *
#let info = toml("config/info.toml").example
#show: chapter-style.with(
title: "Bellman Equation",
info: info,
)
= Bellman Equation
Your content starts here.Calling cover() switches the document to booklet mode.
#import "@preview/qooklet:0.6.2": *
#let info = toml("config/info.toml").example
#cover(info, date: datetime.today())
#epigraph(info: info)[
A short quote or motto.
]
#preface(info: info)[
Preface content.
]
#contents(depth: 2, info: info)
#part-page("Main Text", info: info)
#show: chapter-style.with(
title: "First Chapter",
info: info,
)
= First Section
Chapter content.
#part-page("Appendix", info: info)
#show: appendix-style.with(
title: "Supplementary Material",
info: info,
)
= Additional Notes
Appendix content.Most public functions accept info, styles, or names arguments. The default
values are loaded from 0.1.0/config.
info controls metadata and language. It is commonly passed to cover(),
preface(), contents(), part-page(), chapter-style(), and
appendix-style().
#let info = toml("config/info.toml").example[example]
title = "Your Booklet Name"
author = "Your Name"
footer = "Footer Text"
header = "Header Text"
lang = "en" # "en" or "zh" by defaultQooklet includes English and Chinese labels by default. Add another language by creating a compatible names table and passing it to the style functions.
[sections.fr]
preface = "Préface"
chapter = "Chapitre"
content = "Table des matières"
appendix = "Annexe"
bibliography = "Bibliographie"
[blocks.fr]
algorithm = "Algorithme"
table = "Tableau"
figure = "Figure"
equation = " Eq. "
rule = "Règle"
law = "Loi"#let info = toml("config/info.toml").example
#let names = toml("config/names.toml")
#show: chapter-style.with(
title: "Chapitre 1",
info: info,
names: names,
)Make sure info.lang matches a language key in names and styles.
styles controls page sizes, spacing, font sizes, and font families.
[paper]
note = "a4"
booklet = "iso-b5"
[spaces]
par-indent = 2
par-leading = 1
par-spacing = 1
list-indent = 1.2
block-above = 1
block-below = 1
contents-indent = 1.2
[sizes]
chapter = 24
chapter-index = 50
cover = 36
author = 24
date = 18
epigraph = 16
preface = 22
contents = 22
part = 36
heading-1 = 16
heading-2 = 14
heading-3 = 12
heading-4 = 10.5
context = 10.5
header = 8
footer = 8
[fonts.en]
chapter = "Palatino"
chapter-index = "Palatino"
cover = "Palatino"
author = "Times New Roman"
date = "Times New Roman"
epigraph = "Georgia"
preface = "Georgia"
contents = "Georgia"
part = "Georgia"
context = "Georgia"
math = "Times New Roman"#let styles = toml("config/styles.toml")
#show: chapter-style.with(
title: "Custom Styled Chapter",
styles: styles,
)cover(info, date: datetime.today(), styles: default-styles): creates a cover page and activates booklet mode.epigraph(info: default-info, styles: default-styles)[body]: creates an epigraph page.preface(info: default-info, styles: default-styles, names: default-names)[body]: creates a preface page.contents(depth: 2, info: default-info, styles: default-styles): creates a table of contents.depthcan be1or2.part-page(title, info: default-info, styles: default-styles): creates a part divider page.
chapter-style(title: "", info: default-info, styles: default-styles, names: default-names, outline-on: false, heading-depth: 3)[body]: applies chapter layout, headers, footers, heading styles, numbering, references, and theorem styling.appendix-style(...): same aschapter-style(), but uses appendix numbering.front-matter-style(styles: default-styles)[body]: styles front matter pages.cover-style(styles: default-styles)[body]: applies cover/booklet page style.contents-style(depth: 2, lang: "en", names: default-names, styles: default-styles)[body]: lower-level table-of-contents style helper.
tableq(data, k, inset: 0.3em, stroke-color: rgb("000")) renders flattened CSV
data as a centered table using Qooklet's three-line style.
#let data = csv("data.csv")
#figure(
tableq(data, 5, inset: 0.31em),
caption: "Dataset Summary",
supplement: "Table",
kind: table,
)Available stroke helpers:
table-three-line(stroke-color): three-line table style.table-no-left-right(stroke-color): grid style without left and right borders.
Use the stroke helpers directly with Typst's built-in table when you need more
control than tableq() exposes.
code(text, lang: "python", breakable: true, width: 100%) renders a styled raw
code block from a string.
#let compose = read("docker-compose.yml")
#code(compose, lang: "yaml")examples/example.typ: a compact note-mode example.examples/example-book.typ: a booklet-mode tutorial and regression example.
Qooklet is inspired by haobook by @ParaN3xus.