Skip to content

Commit 8281124

Browse files
committed
0.1.4
1 parent ea97369 commit 8281124

File tree

5 files changed

+74
-17
lines changed

5 files changed

+74
-17
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Follow formatting guidelines from https://gsas.harvard.edu/resource/dissertation
55

66
# Changelog
77

8+
## 0.1.4
9+
- Added `appendix()` function for appendix, which resets numbering to start with `A.`
10+
- fix equation numbering style to include `()`
11+
812
## 0.1.3
913
- Improved figure caption alignment, size, and separation
1014

lib.typ

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@
3737
]
3838
show heading.where(level: 1): smallcaps
3939
show heading.where(level: 1): it => {
40-
counter(math.equation).update(0)
41-
counter(figure.where(kind: image)).update(0)
42-
counter(figure.where(kind: table)).update(0)
43-
counter(figure.where(kind: raw)).update(0)
44-
it
40+
counter(math.equation).update(0)
41+
counter(figure.where(kind: image)).update(0)
42+
counter(figure.where(kind: table)).update(0)
43+
counter(figure.where(kind: raw)).update(0)
44+
it
4545
}
46+
4647
set math.equation(numbering: (..num) =>
47-
numbering("(1.1)", counter(heading).get().first(), num.pos().first())
48+
numbering("(1.1.1)", counter(heading).get().first(), ..num)
4849
)
4950
set figure(numbering: (..num) =>
50-
numbering("1.1", counter(heading).get().first(), num.pos().first())
51+
numbering("1.1.1", counter(heading).get().first(), ..num)
5152
)
5253
set page(numbering:none)
5354
set align(center + horizon)
@@ -123,13 +124,13 @@
123124

124125
show ref: it => {set text(fill: school-color); it}
125126
show figure.caption: it => [
126-
#set text(size: 10pt)
127-
#set par(justify:true)
128-
#set align(left)
129-
#strong([#it.supplement
130-
#context it.counter.display(it.numbering):
131-
]) #it.body
132-
]
127+
#set text(size: 10pt)
128+
#set par(justify:true)
129+
#set align(left)
130+
#strong([#it.supplement
131+
#context it.counter.display(it.numbering):
132+
]) #it.body
133+
]
133134

134135
outline(
135136
title: grid([
@@ -140,9 +141,44 @@
140141
])
141142
)
142143

143-
144144
set page(numbering:none)
145145
counter(page).update(1)
146146
set page(numbering:"1")
147147
doc
148148
}
149+
150+
#let appendix(
151+
doc
152+
) = {
153+
set heading(numbering: (..num) =>
154+
"A." + numbering("1", num.pos().last())
155+
)
156+
show heading.where(
157+
level: 1, outlined: true
158+
): it => [
159+
#set align(right)
160+
#set text(20pt, weight: "regular")
161+
#pagebreak()
162+
#v(25%)
163+
#text(100pt, school-color, "A")\
164+
#text(24.88pt, it.body)
165+
#v(4em)
166+
]
167+
show heading.where(level: 1): smallcaps
168+
169+
show heading.where(level: 1): it => {
170+
counter(math.equation).update(0)
171+
counter(figure.where(kind: image)).update(0)
172+
counter(figure.where(kind: table)).update(0)
173+
counter(figure.where(kind: raw)).update(0)
174+
it
175+
}
176+
177+
set math.equation(numbering: (..num) =>
178+
"(A." + numbering("1.1", ..num) + ")"
179+
)
180+
set figure(numbering: (..num) =>
181+
"A." + numbering("1.1", ..num)
182+
)
183+
doc
184+
}

templates/main.pdf

40.4 KB
Binary file not shown.

templates/main.typ

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import "@preview/harvard-gsas-thesis-oat:0.1.3": frontmatter, school-color
1+
#import "@preview/harvard-gsas-thesis-oat:0.1.4": frontmatter, school-color, appendix
22

33
#let ifb = $"fb"^(-1)$
44
#let total-lumi = [140 #ifb]
@@ -55,4 +55,21 @@ $
5555
0.002(x + 89.6)^(-1.06log(x))
5656
$
5757

58+
#show: appendix.with()
5859

60+
= Appendix
61+
62+
#lorem(20) @appendix_figure
63+
$
64+
a^2 + b^2 = c^2
65+
$
66+
67+
== Appendix is hard
68+
$
69+
a^3 + b^3 = c^3
70+
$
71+
72+
#figure(
73+
rect(fill: school-color),
74+
caption: [Here's a figure in Appendix],
75+
) <appendix_figure>

typst.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "harvard-gsas-thesis-oat"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
entrypoint = "lib.typ"
55
authors = ["Moelf <https://github.com/Moelf>"]
66
license = "MIT"

0 commit comments

Comments
 (0)