A modern, publication-grade Typst template and component package designed for university professors, instructors, and teaching assistants to create clean, beautifully structured lecture notes, problem sets, and study guides for students.
- 🎓 Dual Mode System (
student/instructor):- Student Mode: Hides solution details (provides student workspace boxes) and omits teaching notes.
- Instructor Mode: Highlights complete solution keys and displays dedicated
#instructor-noteblocks for TAs and instructors.
- 📐 Rich Callout & Environment Suite:
- Built-in styled environments for Theorems, Definitions, Lemmas, Corollaries, Proofs, Examples, Exercises, Notes, Tips, Warnings, Important Reminders, and Instructor Notes.
- 📅 Lecture Organization Helpers:
#lecture(...)header blocks with date pill badges and topic list summary.#learning-objectives(...)checklist module.#key-terms(...)concept grid layout.
- 🎨 Publication-Grade Design:
- Top course metadata cover banner.
- Clean running headers and footers with page counts (
Page X of Y). - Customizable accent color schemes and typography.
- Formatted code block & inline code highlights.
Place lib.typ into your project directory or reference it relative to your document:
#import "lib.typ": *
#show: class-notes.with(
title: "Algorithms & Data Structures",
subtitle: "Official Class Notes",
course: "CS 301: Data Structures & Algorithms",
course-code: "CS 301",
semester: "Fall 2026",
university: "Department of Computer Science, State University",
author: "Prof. Alan Turing",
instructor-email: "a.turing@university.edu",
date: "October 2026",
accent-color: rgb("#1d4ed8"),
mode: "student", // Set to "instructor" for solution keys & teaching notes
)
= Lecture 1: Introduction
#lecture(
number: 1,
title: "Asymptotic Complexity",
date: "Oct 12, 2026",
topics: ("Big-O Notation", "Recurrences")
)
#learning-objectives((
[Master Big-O, Big-Omega, and Big-Theta definitions.],
[Solve divide-and-conquer recurrences with the Master Theorem.]
))
== 1.1 Big-O Definition
#definition(title: "Big-O Notation")[
Let $f(n)$ and $g(n)$ be functions from $NN$ to $RR^+$. We write $f(n) = O(g(n))$ if:
$ f(n) <= c dot g(n) quad "for all" n >= n_0 $
]
#exercise(
title: "Recurrence Bounds",
solution: [ $T(n) = Theta(n^2)$ by Case 1 of the Master Theorem. ],
[ Find the tight bound for $T(n) = 4 T(n/2) + n$. ]
)When published as an open-source package on Typst Universe, users can initialize a new document instantly:
typst init @preview/modern-class-notes my-course-notes
cd my-course-notes
typst watch template/main.typ output.pdf| Parameter | Type | Default | Description |
|---|---|---|---|
title |
content/string |
"Class Notes" |
Main document title |
subtitle |
content/string |
none |
Optional secondary subtitle |
course |
content/string |
"COURSE 101: Subject" |
Full course title |
course-code |
content/string |
"CS 101" |
Abbreviated course code for headers |
semester |
content/string |
"Fall 2026" |
Academic term/semester |
university |
content/string |
"Department of..." |
University or department name |
author |
content/string |
"Prof. Jane Doe" |
Professor / Primary Instructor |
instructor-email |
content/string |
none |
Instructor contact email |
date |
content/string |
Today's Date | Publication date |
accent-color |
color |
rgb("#1d4ed8") |
Primary accent color |
mode |
"student" | "instructor" |
"student" |
Toggles solutions and teaching notes |
paper |
string |
"a4" |
Paper size ("a4", "us-letter") |
font-body |
string/array |
"Times New Roman" |
Body font family |
font-header |
string/array |
"Times New Roman" |
Header font family |
show-outline |
bool |
true |
Show table of contents box |
show-title-banner |
bool |
true |
Show top metadata banner |
All callouts accept an optional title parameter and content body:
-
#definition(title: "...", [body])– Sky Blue accent with 📐 icon & auto-counter. -
#theorem(title: "...", [body])– Indigo accent with 🏛️ icon & auto-counter. -
#lemma(title: "...", [body])– Violet accent with 🧩 icon. -
#corollary(title: "...", [body])– Purple accent with 🔗 icon. -
#proof(title: "Proof", [body])– Styled italic proof block with Q.E.D. symbol ($\blacksquare$ ). -
#example(title: "...", [body])– Emerald accent with 🔍 icon & auto-counter. -
#exercise(title: "...", solution: [..], [body])– Amber accent with ✏️ icon. Displays problem for students, and full solution key ininstructormode. -
#note(title: "Note", [body])– Blue note box 📌. -
#important(title: "Important", [body])– Orange warning block 🌟. -
#warning(title: "Warning", [body])– Red alert block⚠️ . -
#tip(title: "Tip", [body])– Green tip block 💡. -
#instructor-note([body])– Purple teaching block 🎓 (only rendered in"instructor"mode).
// Lecture Heading Module
#lecture(
number: 1,
title: "Lecture Title",
date: "Date String",
topics: ("Topic 1", "Topic 2", "Topic 3")
)
// Learning Objectives Checklist
#learning-objectives((
[Objective item 1],
[Objective item 2],
))
// Vocabulary Key Terms Grid
#key-terms((
"Term 1": [Definition of term 1],
"Term 2": [Definition of term 2],
))This package includes a standardized typst.toml manifest ready for submission to the official typst/packages GitHub repository.
Modern-Class-Notes/
├── typst.toml # Package manifest & metadata
├── lib.typ # Main package implementation
├── README.md # Package documentation
├── LICENSE # Open-source MIT License
└── template/
└── main.typ # Starter template for users
This project is licensed under the MIT License.