Skip to content

Commit

Permalink
Fix author note (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvuorre committed Mar 13, 2024
1 parent f24e6f5 commit 03ba39c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 59 deletions.
37 changes: 16 additions & 21 deletions _extensions/apaish-document/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,27 @@
align(center)[
#block(below: leading*2)[
#set text(size: fontsize*1.15)
#let alast = authors.pop()
#if authors.len() > 1 {
// If multiple authors, join appropriately
// Formatting depends on N authors 1, 2, or 2+
#if authors.len() > 2 {
for a in authors [
#a.name#super[#a.affiliations],
] + [and #alast.name#super[#alast.affiliations]]
} else {
// If only one author, format a string
[#alast.name#super[#alast.affiliations]]
#a.name#super[#a.affiliations]#if a.note == "true" [#footnote(numbering: "*", [Send correspondence to #a.name, #a.email. #authornote])]#if a!=authors.at(authors.len()-1) [#if a==authors.at(authors.len()-2) [, and] else [,]]
]
}
#if authors.len() == 2 {
for a in authors [
#a.name#super[#a.affiliations]#if a.note == "true" [#footnote(numbering: "*", [Send correspondence to #a.name, #a.email. #authornote])]#if a!=authors.at(authors.len()-1) [and]
]
}
#if authors.len() == 1 {
for a in authors [
#a.name#super[#a.affiliations]#if a.note == "true" [#footnote(numbering: "*", [Send correspondence to #a.name, #a.email. #authornote])]
]
}
]
#counter(footnote).update(0)
]
}

if affiliations != none {
align(center)[
#block(below: leading*2)[
Expand All @@ -97,18 +104,6 @@
]
}

place(
bottom, float: true, clearance: 1em,
[
#line(length: 100%, stroke: 0.5pt)
#set text(size: fontsize*0.85)
#authornote
// todo: The corresponding YAML field doesn't seem to work, so hacky
Correspondence concerning this article should be addressed to
#for a in authors [#if a.note == "true" [#a.name, #a.email]].
]
)

/* Redefine headings up to level 5 */
show heading.where(
level: 1
Expand Down
35 changes: 15 additions & 20 deletions _extensions/apaish-journal/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,24 @@
align(center)[
#block(below: leading*2)[
#set text(size: fontsize*1.3)
#let alast = authors.pop()
#if authors.len() > 1 {
// If multiple authors, join appropriately
// Formatting depends on N authors 1, 2, or 2+
#if authors.len() > 2 {
for a in authors [
#a.name#super[#a.affiliations],
] + [and #alast.name#super[#alast.affiliations]]
} else {
// If only one author, format a string
[#alast.name#super[#alast.affiliations]]
#a.name#super[#a.affiliations]#if a.note == "true" [#footnote(numbering: "*", [Send correspondence to #a.name, #a.email. #authornote])]#if a!=authors.at(authors.len()-1) [#if a==authors.at(authors.len()-2) [, and] else [,]]
]
}
#if authors.len() == 2 {
for a in authors [
#a.name#super[#a.affiliations]#if a.note == "true" [#footnote(numbering: "*", [Send correspondence to #a.name, #a.email. #authornote])]#if a!=authors.at(authors.len()-1) [and]
]
}
#if authors.len() == 1 {
for a in authors [
#a.name#super[#a.affiliations]#if a.note == "true" [#footnote(numbering: "*", [Send correspondence to #a.name, #a.email. #authornote])]
]
}
]
#counter(footnote).update(0)
]
}

Expand All @@ -97,18 +104,6 @@
]
}

place(
bottom, float: true, clearance: 1em,
[
#line(length: 100%, stroke: 0.5pt)
#set text(size: fontsize*0.85)
#authornote
// todo: The corresponding YAML field doesn't seem to work, so hacky
Correspondence concerning this article should be addressed to
#for a in authors [#if a.note == "true" [#a.name, #a.email]].
]
)

/* Redefine headings up to level 5 */
show heading.where(
level: 1
Expand Down
33 changes: 15 additions & 18 deletions _extensions/apaish-manuscript/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,24 @@
if authors != none {
align(center)[
#block(above: leading, below: leading)[
#let alast = authors.pop()
#if authors.len() > 1 {
// If multiple authors, join appropriately
// Formatting depends on N authors 1, 2, or 2+
#if authors.len() > 2 {
for a in authors [
#a.name#super[#a.affiliations],
] + [and #alast.name#super[#alast.affiliations]]
} else {
// If only one author, format a string
[#alast.name#super[#alast.affiliations]]
#a.name#super[#a.affiliations]#if a.note == "true" [#footnote(numbering: "*", [Send correspondence to #a.name, #a.email. #authornote])]#if a!=authors.at(authors.len()-1) [#if a==authors.at(authors.len()-2) [, and] else [,]]
]
}
#if authors.len() == 2 {
for a in authors [
#a.name#super[#a.affiliations]#if a.note == "true" [#footnote(numbering: "*", [Send correspondence to #a.name, #a.email. #authornote])]#if a!=authors.at(authors.len()-1) [and]
]
}
#if authors.len() == 1 {
for a in authors [
#a.name#super[#a.affiliations]#if a.note == "true" [#footnote(numbering: "*", [Send correspondence to #a.name, #a.email. #authornote])]
]
}
]
#counter(footnote).update(0)
]
}

Expand All @@ -78,16 +85,6 @@
]
}

align(
bottom,
[
#align(center, text(weight: "bold", "Author note"))
#authornote
// todo: The corresponding YAML field doesn't seem to work, so hacky
Correspondence concerning this article should be addressed to
#for a in authors [#if a.note == "true" [#a.name, #a.email]].
]
)
pagebreak()

if abstract != none {
Expand Down

0 comments on commit 03ba39c

Please sign in to comment.