Skip to content

Commit 8ad5787

Browse files
bojohnson5Bo Johnsonsaecki
authored
modern-iu-thesis:0.1.4 (#3237)
Co-authored-by: Bo Johnson <bojohnson@Bos-MacBook-Pro.local> Co-authored-by: Tobias Schmitz <tobiasschmitz2001@gmail.com>
1 parent 8e4c61d commit 8ad5787

File tree

6 files changed

+347
-0
lines changed

6 files changed

+347
-0
lines changed
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) 2024 Bo Johnson
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.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# modern-iu-thesis
2+
3+
IU thesis template in Typst
4+
5+
Simple template which meets thesis and dissertation [requirements](https://graduate.indiana.edu/academic-requirements/thesis-dissertation/index.html) of IU Bloomington's
6+
Graduate School. This template provides a couple functions:
7+
8+
```typst
9+
#show: thesis.with(
10+
title: [content],
11+
author: [content],
12+
dept: [content],
13+
year: [content],
14+
month: [content],
15+
day: [content],
16+
committee: (
17+
(
18+
name: "Person 1",
19+
title: "Ph.D.",
20+
),
21+
),
22+
dedication: [content],
23+
acknowledgement: [content],
24+
abstract: [content],
25+
body-font-size: 11pt,
26+
caption-font-size: 11pt,
27+
)
28+
```
29+
30+
and
31+
32+
```typst
33+
#iuquote(content)
34+
```
35+
36+
Everything else follows along with basic Typst syntax such as headings, figures, tables, etc. See
37+
the provided template as an example.
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
#let thesis(
2+
title: none,
3+
author: none,
4+
dept: none,
5+
year: none,
6+
month: none,
7+
day: none,
8+
committee: (),
9+
dedication: none,
10+
acknowledgement: [],
11+
abstract: [],
12+
body-font-size: 11pt,
13+
caption-font-size: 11pt,
14+
doc,
15+
) = {
16+
set text(size: body-font-size)
17+
set par(leading: 1.5em, first-line-indent: 1em, justify: true, spacing: 1.5em)
18+
set page(
19+
margin: (x: 1in, y: 1in),
20+
paper: "us-letter",
21+
footer: context {
22+
set align(center)
23+
if counter(page).get().at(0) != 1 {
24+
[#counter(page).display("i")]
25+
} else {
26+
[]
27+
}
28+
},
29+
)
30+
31+
let fmt-eq-number(sec, eq) = numbering("(1.1)", sec, eq)
32+
show math.equation: it => {
33+
if it.has("label") {
34+
math.equation(
35+
block: true,
36+
numbering: eq_idx => context {
37+
let sec = counter(heading.where(level: 1)).get().at(0)
38+
fmt-eq-number(sec, eq_idx)
39+
},
40+
it,
41+
)
42+
} else {
43+
it
44+
}
45+
}
46+
47+
show ref: it => {
48+
let el = it.element
49+
if el != none and el.func() == math.equation {
50+
let sec = counter(heading.where(level: 1)).at(el.location()).at(0)
51+
let eq = counter(math.equation).at(el.location()).at(0) + 1
52+
53+
link(
54+
el.location(),
55+
[Eq.~#fmt-eq-number(sec, eq)],
56+
)
57+
} else {
58+
it
59+
}
60+
}
61+
62+
grid(
63+
columns: 1fr,
64+
rows: (1fr, 1fr, 1fr),
65+
align(center + horizon, text(16pt)[#smallcaps([#title])]),
66+
align(center + horizon)[#author],
67+
align(
68+
center + horizon,
69+
)[Submitted to the Faculty of the Graduate School \ in partial fulfillment of the requirements \ for the degree \ Doctor of Philosophy \ in the Department of #dept, \ Indiana University \ #month #year],
70+
)
71+
72+
pagebreak()
73+
74+
align(
75+
center,
76+
)[Accepted by the Graduate Faculty, Indiana University, in partial fulfillment of the requirements for the degree of Doctor of Philosophy.]
77+
78+
v(2em)
79+
80+
[Doctoral Committee]
81+
82+
v(3em)
83+
84+
for member in committee {
85+
[
86+
#align(right)[#line(length: 50%, stroke: 0.5pt)]
87+
#v(-0.75em)
88+
#align(right)[#member.name, #member.title]
89+
#v(3em)
90+
]
91+
}
92+
93+
v(1fr)
94+
95+
align(left)[#day #month #year]
96+
97+
pagebreak()
98+
99+
align(center + horizon)[Copyright \u{00a9} #year \ #author]
100+
101+
pagebreak()
102+
103+
if dedication != none {
104+
align(center + horizon)[#emph[#dedication]]
105+
pagebreak()
106+
}
107+
108+
text(15pt)[#align(center)[
109+
*Acknowledgments*
110+
]]
111+
112+
[#acknowledgement]
113+
114+
pagebreak()
115+
116+
align(center)[#author]
117+
118+
119+
align(center, text(16pt)[#smallcaps([#title])])
120+
121+
122+
[#abstract]
123+
124+
v(3em)
125+
126+
for member in committee {
127+
[
128+
#align(right)[#line(length: 50%, stroke: 0.5pt)]
129+
#v(-0.75em)
130+
#align(right)[#member.name, #member.title]
131+
#v(2em)
132+
]
133+
}
134+
135+
pagebreak()
136+
137+
show outline: set par(leading: 0.75em)
138+
139+
show outline.entry.where(level: 1): it => {
140+
v(12pt, weak: true)
141+
it
142+
}
143+
144+
outline(indent: auto)
145+
146+
pagebreak()
147+
148+
outline(
149+
target: figure.where(kind: image),
150+
indent: auto,
151+
title: [List of Figures],
152+
)
153+
154+
pagebreak()
155+
156+
outline(
157+
target: figure.where(kind: table),
158+
indent: auto,
159+
title: [List of Tables],
160+
)
161+
162+
pagebreak()
163+
164+
outline(
165+
target: figure.where(kind: raw),
166+
indent: auto,
167+
title: [List of Code Examples],
168+
)
169+
170+
pagebreak()
171+
172+
set page(
173+
numbering: "1",
174+
footer: context [
175+
#set align(center)
176+
#counter(page).display()
177+
],
178+
)
179+
set heading(numbering: "1.1.1")
180+
show heading: it => [
181+
#v(12pt)
182+
#it
183+
#v(12pt)
184+
]
185+
show heading.where(level: 1): it => {
186+
counter(math.equation).update(0)
187+
if it.body == [Bibliography] {
188+
it
189+
} else {
190+
pagebreak(weak: true)
191+
align(center)[Chapter
192+
#counter(heading).display(it.numbering):
193+
#it.body
194+
#v(12pt)
195+
]
196+
}
197+
}
198+
show figure.caption: it => {
199+
set par(leading: 0.65em)
200+
set text(size: caption-font-size)
201+
emph(it)
202+
}
203+
set figure(gap: 2em)
204+
205+
doc
206+
}
207+
208+
#let iuquote(body) = {
209+
set par(leading: 0.65em)
210+
pad(x: 30pt, y: 15pt, body)
211+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#import "@preview/modern-iu-thesis:0.1.4": *
2+
3+
#show: thesis.with(
4+
title: [My Thesis],
5+
author: [My Name],
6+
dept: [My Department],
7+
year: [Year],
8+
month: [Month],
9+
day: [Day],
10+
committee: (
11+
(
12+
name: "Committee Member 1",
13+
title: "Ph.D.",
14+
),
15+
(
16+
name: "Committee Member 2",
17+
title: "Ph.D.",
18+
),
19+
(
20+
name: "Committee Member 3",
21+
title: "Ph.D.",
22+
),
23+
(
24+
name: "Committee Member 4",
25+
title: "Ph.D.",
26+
),
27+
),
28+
dedication: [Dedication],
29+
acknowledgement: lorem(100),
30+
abstract: lorem(100),
31+
)
32+
33+
= Introduction
34+
35+
#lorem(100)
36+
37+
== History
38+
39+
#lorem(100)
40+
41+
#align(center)[
42+
#figure(emoji.explosion, caption: [Kapow!])
43+
]
44+
45+
#lorem(200)
46+
47+
#iuquote([#lorem(50)])
48+
49+
=== More History
50+
51+
$ delta S & = delta integral cal(L) dif t = 0 $
52+
53+
#align(center)[
54+
#figure(
55+
table(
56+
columns: 3,
57+
table.header([], [*Thing 1*], [*Thing 2*]),
58+
[Experiment 1], [1.0], [2.0],
59+
[Experiment 2], [3.0], [4.0],
60+
),
61+
caption: [My table],
62+
)
63+
]
36.8 KB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "modern-iu-thesis"
3+
version = "0.1.4"
4+
entrypoint = "lib.typ"
5+
authors = ["Bo Johnson"]
6+
license = "MIT"
7+
description = "Modern Typst thesis template for Indiana University"
8+
repository = "https://github.com/bojohnson5/modern-iu-thesis"
9+
keywords = ["thesis"]
10+
categories = ["thesis"]
11+
12+
[template]
13+
path = "template"
14+
entrypoint = "main.typ"
15+
thumbnail = "thumbnail.png"

0 commit comments

Comments
 (0)