Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions lapreprint.typ
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
) = {

/* Logos */
let orcidSvg = ```<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24"> <path fill="#AECD54" d="M21.8,12c0,5.4-4.4,9.8-9.8,9.8S2.2,17.4,2.2,12S6.6,2.2,12,2.2S21.8,6.6,21.8,12z M8.2,5.8c-0.4,0-0.8,0.3-0.8,0.8s0.3,0.8,0.8,0.8S9,7,9,6.6S8.7,5.8,8.2,5.8z M10.5,15.4h1.2v-6c0,0-0.5,0,1.8,0s3.3,1.4,3.3,3s-1.5,3-3.3,3s-1.9,0-1.9,0H10.5v1.1H9V8.3H7.7v8.2h2.9c0,0-0.3,0,3,0s4.5-2.2,4.5-4.1s-1.2-4.1-4.3-4.1s-3.2,0-3.2,0L10.5,15.4z"/></svg>```.text
let orcidSvg = bytes(```<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24"> <path fill="#AECD54" d="M21.8,12c0,5.4-4.4,9.8-9.8,9.8S2.2,17.4,2.2,12S6.6,2.2,12,2.2S21.8,6.6,21.8,12z M8.2,5.8c-0.4,0-0.8,0.3-0.8,0.8s0.3,0.8,0.8,0.8S9,7,9,6.6S8.7,5.8,8.2,5.8z M10.5,15.4h1.2v-6c0,0-0.5,0,1.8,0s3.3,1.4,3.3,3s-1.5,3-3.3,3s-1.9,0-1.9,0H10.5v1.1H9V8.3H7.7v8.2h2.9c0,0-0.3,0,3,0s4.5-2.2,4.5-4.1s-1.2-4.1-4.3-4.1s-3.2,0-3.2,0L10.5,15.4z"/></svg>```.text)

let spacer = text(fill: gray)[#h(8pt) | #h(8pt)]

let dates;
if (type(date) == "datetime") {
if (type(date) == datetime) {
dates = ((title: "Published", date: date),)
}else if (type(date) == "dictionary") {
}else if (type(date) == dictionary) {
dates = (date,)
} else {
dates = date
Expand All @@ -80,19 +80,19 @@
set page(
paper-size,
margin: (left: 25%),
header: locate(loc => {
if(loc.page() == 1) {
header: context {
if(here().page() == 1) {
let headers = (
if (open-access) {smallcaps[Open Access]},
if (doi != none) { link("https://doi.org/" + doi, "https://doi.org/" + doi)}
)
return align(left, text(size: 8pt, fill: gray, headers.filter(header => header != none).join(spacer)))
align(left, text(size: 8pt, fill: gray, headers.filter(header => header != none).join(spacer)))
} else {
return align(right, text(size: 8pt, fill: gray.darken(50%),
align(right, text(size: 8pt, fill: gray.darken(50%),
(short-title, short-citation).join(spacer)
))
}
}),
},
footer: block(
width: 100%,
stroke: (top: 1pt + gray),
Expand All @@ -109,7 +109,11 @@
#text(
size: 9pt, fill: gray.darken(50%)
)[
#counter(page).display() of #locate((loc) => {counter(page).final(loc).first()})
#context {
counter(page).display()
[ of ]
str(counter(page).final().first())
}
]
]
)
Expand All @@ -129,9 +133,9 @@

// Configure headings.
set heading(numbering: heading-numbering)
show heading: it => locate(loc => {
show heading: it => context {
// Find out the final number of the heading counter.
let levels = counter(heading).at(loc)
let levels = counter(heading).at(here())
set text(10pt, weight: 400)
if it.level == 1 [
// First-level headings are centered smallcaps.
Expand Down Expand Up @@ -168,7 +172,7 @@
}
_#(it.body):_
]
})
}


if (logo != none) {
Expand All @@ -179,7 +183,7 @@
box(
width: 27%,
{
if (type(logo) == "content") {
if (type(logo) == content) {
logo
} else {
image(logo, width: 100%)
Expand All @@ -206,7 +210,7 @@
super(author.affiliations)
}
if "orcid" in author {
link("https://orcid.org/" + author.orcid)[#box(height: 1.1em, baseline: 13.5%)[#image.decode(orcidSvg)]]
link("https://orcid.org/" + author.orcid)[#box(height: 1.1em, baseline: 13.5%)[#image(orcidSvg)]]
}
}).join(", ", last: ", and ")
})
Expand All @@ -228,7 +232,7 @@
dy: -10pt,
box(width: 27%, {
if (kind != none) {
show par: set block(spacing: 0em)
set par(spacing: 0em)
text(11pt, fill: theme, weight: "semibold", smallcaps(kind))
parbreak()
}
Expand Down Expand Up @@ -267,7 +271,7 @@


let abstracts
if (type(abstract) == "content") {
if (type(abstract) == content) {
abstracts = (title: "Abstract", content: abstract)
} else {
abstracts = abstract
Expand All @@ -292,7 +296,7 @@
}
v(10pt)

show par: set block(spacing: 1.5em)
set par(spacing: 1.5em)

// Display the paper's contents.
body
Expand Down