|
1 | 1 | #let school-color = rgb(165, 28, 48) |
2 | 2 |
|
3 | 3 | #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 |
14 | 14 | ) = { |
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) |
66 | 37 | ] |
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 | + ) |
68 | 79 |
|
69 | | - pagebreak() |
70 | | - show link: it => {set text(fill: school-color); it} |
| 80 | + pagebreak() |
| 81 | + show link: it => {set text(fill: school-color); it} |
71 | 82 |
|
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 |
77 | 91 | ] |
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 |
121 | 138 | } |
0 commit comments