aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-08-24 09:47:44 +0200
committerJohn MacFarlane <[email protected]>2025-08-24 09:47:44 +0200
commit4c69f288d91460ec4bd0b7588e2f489d1b650b79 (patch)
tree0dd93803f404e3a8f67e8ac410f884b9a8ddca0e /data
parent93f8145fa43facb743b444dac08352f7902dc0aa (diff)
Revert "Add features to typst base template."
This reverts commit f000fa168bd122fee6e67f5a67bdd6d42d173261.
Diffstat (limited to 'data')
-rw-r--r--data/templates/default.typst24
-rw-r--r--data/templates/template.typst100
2 files changed, 37 insertions, 87 deletions
diff --git a/data/templates/default.typst b/data/templates/default.typst
index 4c75fd0f4..c361aa951 100644
--- a/data/templates/default.typst
+++ b/data/templates/default.typst
@@ -71,15 +71,9 @@ $endif$
$if(region)$
region: "$region$",
$endif$
-$if(abstract-title)$
- abstract-title: [$abstract-title$],
-$endif$
$if(abstract)$
abstract: [$abstract$],
$endif$
-$if(thanks)$
- thanks: [$thanks$],
-$endif$
$if(margin)$
margin: ($for(margin/pairs)$$margin.key$: $margin.value$,$endfor$),
$endif$
@@ -92,28 +86,10 @@ $endif$
$if(fontsize)$
fontsize: $fontsize$,
$endif$
-$if(mathfont)$
- mathfont: ($for(mathfont)$"$mathfont$",$endfor$),
-$endif$
-$if(codefont)$
- codefont: ($for(codefont)$"$codefont$",$endfor$),
-$endif$
-$if(linestretch)$
- linestretch: $linestretch$,
-$endif$
$if(section-numbering)$
sectionnumbering: "$section-numbering$",
$endif$
pagenumbering: $if(page-numbering)$"$page-numbering$"$else$none$endif$,
-$if(linkcolor)$
- linkcolor: [$linkcolor$],
-$endif$
-$if(citecolor)$
- citecolor: [$citecolor$],
-$endif$
-$if(filecolor)$
- filecolor: [$filecolor$],
-$endif$
cols: $if(columns)$$columns$$else$1$endif$,
doc,
)
diff --git a/data/templates/template.typst b/data/templates/template.typst
index 1afaa35fc..24b1320fb 100644
--- a/data/templates/template.typst
+++ b/data/templates/template.typst
@@ -15,9 +15,7 @@
authors: (),
keywords: (),
date: none,
- abstract-title: none,
abstract: none,
- thanks: none,
cols: 1,
margin: (x: 1.25in, y: 1.25in),
paper: "us-letter",
@@ -25,90 +23,66 @@
region: "US",
font: (),
fontsize: 11pt,
- mathfont: none,
- codefont: none,
- linestretch: 1,
sectionnumbering: none,
- linkcolor: none,
- citecolor: none,
- filecolor: none,
pagenumbering: "1",
doc,
) = {
set document(
title: title,
- author: authors.map(author => content-to-string(author.name)).join(", ", last: " & "),
+ author: authors.map(author => content-to-string(author.name)),
keywords: keywords,
)
set page(
paper: paper,
margin: margin,
numbering: pagenumbering,
- )
-
- set par(
- justify: true,
- leading: linestretch * 0.65em
- )
+ columns: cols,
+ )
+ set par(justify: true)
set text(lang: lang,
region: region,
font: font,
size: fontsize)
-
- show math.equation: set text(font: mathfont) if mathfont != none
- show raw: set text(font: codefont) if codefont != none
-
set heading(numbering: sectionnumbering)
- show link: set text(fill: rgb(content-to-string(linkcolor))) if linkcolor != none
- show ref: set text(fill: rgb(content-to-string(citecolor))) if citecolor != none
- show link: this => {
- if filecolor != none and type(this.dest) == label {
- text(this, fill: rgb(content-to-string(filecolor)))
- }
+ place(top, float: true, scope: "parent", clearance: 4mm)[
+ #if title != none {
+ align(center)[#block(inset: 2em)[
+ #text(weight: "bold", size: 1.5em)[#title]
+ #(if subtitle != none {
+ parbreak()
+ text(weight: "bold", size: 1.25em)[#subtitle]
+ })
+ ]]
}
- block(below: 4mm)[
- #if title != none {
- align(center)[#block(inset: 2em)[
- #text(weight: "bold", size: 1.5em)[#title #if thanks != none {
- footnote(thanks, numbering: "*")
- counter(footnote).update(n => n - 1)
- }]
- #(
- if subtitle != none {
- parbreak()
- text(weight: "bold", size: 1.25em)[#subtitle]
- }
- )
- ]]
- }
-
- #if authors != none and authors != [] {
- let count = authors.len()
- let ncols = calc.min(count, 3)
- grid(
- columns: (1fr,) * ncols,
- row-gutter: 1.5em,
- ..authors.map(author => align(center)[
- #author.name \
- #author.affiliation \
- #author.email
- ])
+ #if authors != none and authors != [] {
+ let count = authors.len()
+ let ncols = calc.min(count, 3)
+ grid(
+ columns: (1fr,) * ncols,
+ row-gutter: 1.5em,
+ ..authors.map(author =>
+ align(center)[
+ #author.name \
+ #author.affiliation \
+ #author.email
+ ]
)
- }
+ )
+ }
- #if date != none {
- align(center)[#block(inset: 1em)[
- #date
- ]]
- }
+ #if date != none {
+ align(center)[#block(inset: 1em)[
+ #date
+ ]]
+ }
- #if abstract != none {
- block(inset: 2em)[
- #text(weight: "semibold")[#abstract-title] #h(1em) #abstract
- ]
- }
+ #if abstract != none {
+ block(inset: 2em)[
+ #text(weight: "semibold")[$if(abstract-title)$${abstract-title}$else$Abstract$endif$] #h(1em) #abstract
+ ]
+ }
]
doc