Skip to content

Commit 1f14c13

Browse files
committed
0.1.2
1 parent d251364 commit 1f14c13

File tree

5 files changed

+166
-116
lines changed

5 files changed

+166
-116
lines changed

README.md

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

66
# Changelog
77

8+
## 0.1.2
9+
- Fixed title style
10+
- Added Numbering for equations and figures
11+
- Improved margin
12+
813
## 0.1.1
914
- Added `creative_commons` option for front matter
1015
- Fixed title printing just before Abstract

img/thumbnail.png

-2.41 KB
Loading

lib.typ

Lines changed: 129 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,138 @@
11
#let school-color = rgb(165, 28, 48)
22

33
#let frontmatter(
4-
title: none,
5-
abstract: [],
6-
author: "John Harvard",
7-
advisor: "Dear Advisor",
8-
department: "Department of Physics",
9-
doctor-of: "Philosophy",
10-
major: "Physics",
11-
completion-date: datetime.today().display("[month repr:long] [year]"),
12-
creative-commons: true,
13-
doc
4+
title: none,
5+
abstract: [],
6+
author: "John Harvard",
7+
advisor: "Dear Advisor",
8+
department: "Department of Physics",
9+
doctor-of: "Philosophy",
10+
major: "Physics",
11+
completion-date: datetime.today().display("[month repr:long] [year]"),
12+
creative-commons: true,
13+
doc
1414
) = {
15-
set page(
16-
paper:"us-letter",
17-
// margin is automatically 2.5/11 times the short side of us-letter
18-
// which is about 1.01 inch
19-
margin: auto,
20-
numbering: "I",
21-
)
22-
set text(font:"New Computer Modern", size:12pt)
23-
24-
// to mimic Double Spacing
25-
// https://github.com/typst/typst/issues/106#issuecomment-2041051807
26-
set text(top-edge: 0.7em, bottom-edge: -0.3em)
27-
set par(first-line-indent: 3em, justify:true, leading: 1em)
28-
29-
set heading(numbering: "1.1")
30-
show heading.where(
31-
level: 1, outlined: true
32-
): it => [
33-
#set align(right)
34-
#set text(20pt, weight: "regular")
35-
#pagebreak()
36-
#v(30%)
37-
#text(100pt, school-color, counter(heading).display())\
38-
#text(24.88pt, it.body)
39-
#v(3em)
40-
]
41-
show heading.where(level: 1): smallcaps
42-
set page(numbering:none)
43-
set align(center + horizon)
44-
counter(page).update(1)
45-
grid(
46-
[
47-
#text(school-color, 24.88pt)[_#(title)_]
48-
49-
#v(1fr)
50-
#show: smallcaps
51-
52-
A dissertation presented\
53-
by\
54-
#author\
55-
to\
56-
The #department\
57-
in partial fulfillment of the requirements\
58-
for the degree of\
59-
Doctor of #doctor-of\
60-
in the subject of\
61-
#major
62-
#v(3fr)
63-
Harvard University\
64-
Cambridge, Massachusetts\
65-
#completion-date
15+
set page(
16+
paper:"us-letter",
17+
// margin is automatically 2.5/11 times the short side of us-letter
18+
// which is about 1.01 inch
19+
margin: (x: 1.375in,
20+
y: 1.375in
21+
),
22+
numbering: "I",
23+
)
24+
set text(font:"New Computer Modern", size:12pt)
25+
26+
set heading(numbering: "1.1")
27+
show heading.where(
28+
level: 1, outlined: true
29+
): it => [
30+
#set align(right)
31+
#set text(20pt, weight: "regular")
32+
#pagebreak()
33+
#v(25%)
34+
#text(100pt, school-color, counter(heading).display())\
35+
#text(24.88pt, it.body)
36+
#v(4em)
6637
]
67-
)
38+
show heading.where(level: 1): smallcaps
39+
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
45+
}
46+
set math.equation(numbering: (..num) =>
47+
numbering("(1.1)", counter(heading).get().first(), num.pos().first())
48+
)
49+
set figure(numbering: (..num) =>
50+
numbering("1.1", counter(heading).get().first(), num.pos().first())
51+
)
52+
set page(numbering:none)
53+
set align(center + horizon)
54+
counter(page).update(1)
55+
grid(
56+
[
57+
#text(school-color, 24.88pt)[#(title)]
58+
59+
#v(100pt)
60+
#show: smallcaps
61+
62+
A dissertation presented\
63+
by\
64+
#author\
65+
to\
66+
The #department\
67+
#v(12pt)
68+
in partial fulfillment of the requirements\
69+
for the degree of\
70+
Doctor of #doctor-of\
71+
in the subject of\
72+
#major
73+
#v(12pt)
74+
Harvard University\
75+
Cambridge, Massachusetts\
76+
#completion-date
77+
]
78+
)
6879

69-
pagebreak()
70-
show link: it => {set text(fill: school-color); it}
80+
pagebreak()
81+
show link: it => {set text(fill: school-color); it}
7182

72-
[
73-
#if creative-commons [
74-
This work is licensed via #underline[
75-
#link("https://creativecommons.org/licenses/by/4.0/")[CC BY 4.0]
76-
]
83+
[
84+
#if creative-commons [
85+
This work is licensed via #underline[
86+
#link("https://creativecommons.org/licenses/by/4.0/")[CC BY 4.0]
87+
]
88+
]
89+
90+
Copyright #sym.copyright #datetime.today().display("[year]") #author
7791
]
78-
79-
Copyright #sym.copyright #datetime.today().display("[year]") #author
80-
]
81-
pagebreak()
82-
83-
// "Preliminary pages (abstract, table of contents, list of tables, graphs, illustrations, and
84-
// preface) should use small Roman numerals"
85-
set page(numbering: "I")
86-
set align(top)
87-
grid(
88-
columns:(auto, 1fr, auto),
89-
[Dissertation Advisor: #advisor],
90-
[],
91-
[#author]
92-
)
93-
94-
v(5%)
95-
text(school-color, 24.88pt)[_#(title)_]
96-
v(7%)
97-
98-
[*Abstract*]
99-
100-
set align(left)
101-
abstract
102-
pagebreak()
103-
104-
show outline.entry.where(level: 1): set outline.entry(fill: none)
105-
show outline.entry.where(level: 1): it => {smallcaps(it)}
106-
107-
outline(
108-
title: grid([
109-
#set text(23pt)
110-
#h(1fr)
111-
Contents
112-
#v(2em)
113-
])
114-
)
115-
116-
117-
set page(numbering:none)
118-
counter(page).update(1)
119-
set page(numbering:"1")
120-
doc
92+
pagebreak()
93+
94+
// "Preliminary pages (abstract, table of contents, list of tables, graphs, illustrations, and
95+
// preface) should use small Roman numerals"
96+
set page(numbering: "I")
97+
set align(top)
98+
grid(
99+
columns:(auto, 1fr, auto),
100+
[Dissertation Advisor: #advisor],
101+
[],
102+
[#author]
103+
)
104+
105+
v(5%)
106+
text(school-color, 17.28pt)[#(title)]
107+
v(7%)
108+
109+
// to mimic Double Spacing
110+
// https://github.com/typst/typst/issues/106#issuecomment-2041051807
111+
set text(top-edge: 0.7em, bottom-edge: -0.4em)
112+
set par(justify:true, leading: 1em)
113+
114+
115+
[*Abstract*]
116+
117+
set align(left)
118+
abstract
119+
pagebreak()
120+
121+
show outline.entry.where(level: 1): set outline.entry(fill: none)
122+
show outline.entry.where(level: 1): it => {smallcaps(it)}
123+
124+
outline(
125+
title: grid([
126+
#set text(23pt)
127+
#h(1fr)
128+
Contents
129+
#v(2em)
130+
])
131+
)
132+
133+
134+
set page(numbering:none)
135+
counter(page).update(1)
136+
set page(numbering:"1")
137+
doc
121138
}

templates/main.typ

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,40 @@
1-
#import "@preview/harvard-gsas-thesis-oat:0.1.1": frontmatter, school-color
1+
#import "@preview/harvard-gsas-thesis-oat:0.1.2": frontmatter, school-color
2+
3+
#let ifb = $"fb"^(-1)$
4+
#let total-lumi = [140 #ifb]
5+
#let cme = $sqrt(s) = 13 "TeV"$
6+
#let pT = $p_"T"$
27

38
#show: frontmatter.with(
49
title: "Dissertation Title",
5-
abstract: [this is abstract text],
10+
abstract: [
11+
While the search for ever heavier Beyond the Standard Model (BSM) particles is a popular excercise at the
12+
energy frontier, the search for XXX has been less explored. This thesis presents a
13+
search for YYY in a novel #total-lumi dataset collected by the ATLAS experiment during Run 2 at the
14+
Large Hadron Collider (LHC) at #cme. The dataset is unique in that it is collected at the
15+
],
616
author: "John Harvard",
717
advisor: "Melissa Franklin",
818
doctor-of: "Physics",
919
major: "Physics",
1020
)
1121

12-
= The LHC and the ATLAS Experiment
22+
= The LHC and the ATLAS
23+
24+
#lorem(80)
25+
26+
#figure(
27+
table(
28+
columns: 4,
29+
[t], [1], [2], [3],
30+
[y], [0.3s], [0.4s], [0.8s],
31+
),
32+
caption: [Timing results],
33+
)
34+
35+
== Some equations
36+
#lorem(20)
37+
38+
$
39+
0.002(x + 89.6)^(-1.06log(x))
40+
$

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.1"
3+
version = "0.1.2"
44
entrypoint = "lib.typ"
55
authors = ["Moelf <https://github.com/Moelf>"]
66
license = "MIT"

0 commit comments

Comments
 (0)