Skip to content

Commit e8a9ce5

Browse files
committed
chore: initial commit
0 parents  commit e8a9ce5

7 files changed

Lines changed: 283 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Generated files
2+
*.pdf

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Tarun Kumar Jana
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Noteworthy
2+
3+
Noteworthy is a Typst template designed for creating class notes, especially for mathematics. This
4+
template provides a structured and visually appealing format for documenting mathematical concepts,
5+
theorems, proofs, and examples.
6+
7+
## Features
8+
9+
- Customizable document metadata (title, author, contact details)
10+
- Automatic table of contents generation
11+
- Support for various mathematical environments (theorems, proofs, definitions, examples, notes, exercises, solutions)
12+
- Configurable page settings (header, footer, paper size)
13+
- Customizable text settings (font, size, language)
14+
15+
## Installation
16+
17+
You can use this template in the Typst web app by clicking "Start from template" on the dashboard
18+
and searching for noteworthy.
19+
20+
Alternatively, you can use the CLI to kick this project off using the command:
21+
22+
```bash
23+
typst init @preview/noteworthy:0.1.0
24+
```
25+
26+
## Usage
27+
28+
1. Open the `main.typ` file and customize the content as needed.
29+
2. Run the Typst compiler to generate the PDF:
30+
```bash
31+
typst compile main.typ
32+
```
33+
34+
## Environments
35+
36+
This template provides some environments with the help of [theoretic](https://github.com/nleanba/typst-theoretic) package.
37+
38+
Please refer the sample code below for using those environments:
39+
40+
```typst
41+
#definition[
42+
An important definition
43+
]
44+
45+
#example[
46+
Here is an example
47+
]
48+
49+
#theorem(title = "Pythagoras Theorem")[
50+
$"Base"^2 + "Perpendicular"^2 = "Hypotenuse"^2$
51+
]
52+
#note[
53+
A very important note to remember
54+
]
55+
#exercise[
56+
Solve it carefully
57+
]
58+
#solution[
59+
Here is a detailed solution...
60+
]
61+
```
62+
63+
## Acknowledgements
64+
65+
- [Typst](https://typst.app/)
66+
- [theoretic](https://github.com/nleanba/typst-theoretic)
67+
- [Showybox](https://github.com/Pablo-Gonzalez-Calderon/showybox-package)

lib.typ

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
2+
// All imports
3+
#import "@preview/theoretic:0.1.1" as theoretic: theorem, proof, qed
4+
#import "@preview/showybox:2.0.3": showybox
5+
6+
// Main noteworthy function
7+
#let noteworthy(
8+
paper-size: "a4",
9+
font: "New Computer Modern",
10+
language: "EN",
11+
title: none,
12+
author: none,
13+
contact-details: none,
14+
toc-title: "Table of Contents",
15+
content,
16+
) = {
17+
// Document metadata
18+
set document(
19+
title: [#title - #author],
20+
author: author,
21+
date: auto,
22+
)
23+
24+
// Page settings
25+
set page(
26+
paper: paper-size,
27+
header: context {
28+
if (counter(page).get().at(0) > 1) [
29+
#grid(
30+
columns: (1fr, 1fr),
31+
align: (left, right),
32+
smallcaps(title), datetime.today().display("[day]/[month]/[year]"),
33+
)
34+
#line(length: 100%)
35+
]
36+
},
37+
footer: context [
38+
#line(length: 100%)
39+
#grid(
40+
columns: (1fr, 1fr, 1fr),
41+
align: (left, center, right),
42+
author,
43+
if contact-details != none {
44+
[#sym.diamond.filled #link(contact-details) #sym.diamond.filled]
45+
},
46+
counter(page).display(
47+
"(1/1)",
48+
both: true,
49+
),
50+
)
51+
],
52+
)
53+
54+
// Text settings
55+
set text(
56+
font: font,
57+
size: 12pt,
58+
lang: language,
59+
)
60+
61+
// TOC settings
62+
show outline.entry.where(level: 1): it => {
63+
v(12pt, weak: true)
64+
strong(it)
65+
}
66+
67+
// Heading settings
68+
set heading(numbering: "1.")
69+
70+
// Paragraph settings
71+
set par(justify: true)
72+
73+
// Title
74+
showybox(
75+
frame: (
76+
border-color: blue.darken(50%),
77+
body-color: blue.lighten(80%),
78+
),
79+
shadow: (
80+
offset: 3pt,
81+
),
82+
body-style: (
83+
align: center,
84+
),
85+
text(weight: "black", size: 15pt, title),
86+
)
87+
88+
// Table of contents
89+
showybox(
90+
outline(
91+
indent: auto,
92+
title: toc-title,
93+
depth: 2,
94+
),
95+
)
96+
97+
// Main content
98+
content
99+
}
100+
101+
// Custom environments using theoretic
102+
103+
// 1. Definition
104+
#let definition = theorem.with(
105+
kind: "definition",
106+
supplement: "Definition",
107+
fmt-prefix: (s, n, t) => {
108+
text(weight: "bold", stretch: 85%)[#s #n]
109+
if t != none [ (#t)]
110+
h(1em)
111+
},
112+
)
113+
114+
// 2. Example
115+
#let example = theorem.with(
116+
kind: "example",
117+
supplement: "Example",
118+
fmt-prefix: (s, n, t) => {
119+
text(weight: "bold", stretch: 85%)[#s #n]
120+
if t != none [ (#t)]
121+
h(1em)
122+
},
123+
)
124+
125+
// 3. Theorem
126+
#let theorem = theorem.with(
127+
fmt-prefix: (s, n, t) => {
128+
text(weight: "bold", stretch: 85%)[#s #n]
129+
if t != none [ (#t)]
130+
h(1em)
131+
},
132+
)
133+
134+
// 4. Note
135+
#let note = theorem.with(
136+
kind: "note",
137+
supplement: "Note",
138+
fmt-prefix: (s, n, t) => {
139+
text(weight: "bold", stretch: 85%)[#s #n]
140+
if t != none [ (#t)]
141+
h(1em)
142+
},
143+
)
144+
145+
// 5. Exercise
146+
#let exercise = theorem.with(
147+
kind: "exercise",
148+
supplement: "Exercise",
149+
fmt-prefix: (s, n, t) => {
150+
text(weight: "bold", stretch: 85%)[#s #n]
151+
if t != none [ (#t)]
152+
h(1em)
153+
},
154+
)
155+
156+
// 6. Solution
157+
#let solution = theorem.with(
158+
kind: "solution",
159+
supplement: "Solution",
160+
fmt-prefix: (s, n, t) => {
161+
text(weight: "bold")[#s:]
162+
if t != none [ (#t)]
163+
h(1em)
164+
},
165+
)

template/main.typ

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#import "@preview/noteworthy:0.1.0": *
2+
3+
#show: noteworthy.with(
4+
paper-size: "a4",
5+
font: "New Computer Modern",
6+
language: "EN",
7+
title: "Title of The Document",
8+
author: "Your Name",
9+
contact-details: "https://example.com", // Optional: Maybe a link to your website, or phone number
10+
toc-title: "Table of Contents",
11+
)
12+
13+
// Write here

thumbnail.png

186 KB
Loading

typst.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "noteworthy"
3+
version = "0.1.0"
4+
entrypoint = "lib.typ"
5+
authors = ["Tarun Kumar Jana <https://tarunjana.in>"]
6+
license = "MIT"
7+
description = "A Typst template for creating class notes especially for Mathematics"
8+
repository = "https://github.com/tarunjana/noteworthy"
9+
keywords = ["typst-template", "class-notes", "mathematics"]
10+
categories = ["report"]
11+
12+
[template]
13+
path = "template"
14+
entrypoint = "main.typ"
15+
thumbnail = "thumbnail.png"

0 commit comments

Comments
 (0)