hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-18 12:16:44 +0200
committerhachem <im@hachem.wtf>2026-09-18 12:16:44 +0200
commitab2774b23c66521e13541ab3e361bba95c394a8a (patch)
tree8b06b5f2d15a2225f558202c9aaefd20dff8e6b4 /templates
feat: add paper template
Diffstat (limited to 'templates')
-rw-r--r--templates/paper.typ82
1 files changed, 82 insertions, 0 deletions
diff --git a/templates/paper.typ b/templates/paper.typ
new file mode 100644
index 0000000..c7658ec
--- /dev/null
+++ b/templates/paper.typ
@@ -0,0 +1,82 @@
+#let paper-title(title, date) = [
+ #place(top + center, float: true)[
+ #block(width: 100%)[
+ #align(center)[
+ #text(size: 18pt)[#smallcaps[#title]] \
+ #v(0em)
+ #text(size: 12pt)[--- #smallcaps(date) ---]
+ ]
+ ]
+ ]
+]
+
+#let author-block(authors) = [
+ #align(center)[
+ #for author in authors [
+ #author.name \
+ #text(style: "italic")[#author.location]
+ ]
+ ]
+ #v(1.2em)
+]
+
+#let abstract-block(body) = [
+ #block(width: 100%)[
+ #text(weight: "bold")[Abstract---]
+ #body
+ ]
+ #v(0.8em)
+]
+
+#let paper(
+ title: none,
+ date: none,
+ authors: (),
+ abstract: none,
+ font: "EB Garamond",
+ size: 10pt,
+ doc,
+) = {
+ set document(title: title, author: authors.map(author => author.name))
+
+ set page(
+ paper: "a4",
+ margin: (top: 19mm, bottom: 25mm, left: 16mm, right: 16mm),
+ columns: 2,
+ numbering: "- 1/1 -",
+ )
+
+ set par(justify: true, leading: 0.55em)
+ set text(font: font, size: size)
+ set figure(gap: 0.65em)
+
+ show heading.where(level: 1): it => [
+ #v(0.8em)
+ #text(size: 12pt, weight: "medium")[#align(center)[#smallcaps[#it.body]]]
+ #v(0.35em)
+ ]
+
+ show heading.where(level: 2): it => [
+ #v(0.6em)
+ #align(right)[#text(size: 10pt, style: "italic")[#it.body]]
+ #v(0.25em)
+ ]
+
+ show heading.where(level: 3): it => [
+ #v(0.5em)
+ #text(size: 10pt, weight: "bold", style: "italic")[#it.body]
+ #v(0.15em)
+ ]
+
+ show figure.where(kind: table): set text(size: 8.5pt)
+ show bibliography: set text(size: 8.5pt)
+
+ paper-title(title, date)
+ author-block(authors)
+
+ if abstract != none {
+ abstract-block(abstract)
+ }
+
+ doc
+}