Skip to content

Commit d24ce3f

Browse files
committed
Add shortforms for author list
1 parent bf7ee53 commit d24ce3f

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

jacow.typ

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,21 @@
2020
body,
2121
) = {
2222

23-
// ensure author affiliation is a list
23+
// sanitize author list
2424
authors = authors.map(a => {
25-
if type(a.affiliation) == str {
25+
if "by" in a.keys() { a.insert("name", a.remove("by")) }
26+
if "at" in a.keys() { a.insert("affiliation", a.remove("at")) }
27+
if type(a.affiliation) == str { // ensure affiliation is an array
2628
a.insert("affiliation", (a.remove("affiliation"),));
2729
}; a
2830
})
31+
for a in authors.filter(a => "names" in a.keys()) {
32+
for name in a.remove("names") {
33+
authors.insert(-1, (name: name, ..a))
34+
}
35+
}
36+
authors = authors.filter(a => "name" in a.keys())
37+
2938
// sort authors: corresponding first, then alphabetic by last name
3039
authors = authors.sorted(key: a => if "email" in a {" "} + a.name.split(" ").last())
3140

@@ -163,7 +172,7 @@
163172
// primary affiliations
164173
{
165174
show regex(" "): sym.space.nobreak
166-
affiliations.at(aff) + "\n"
175+
affiliations.at(aff) + "\n"
167176
}
168177
};
169178
// secondary affiliations

template/paper.typ

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
],
2020
// Author list
2121
authors: (
22-
(name: "C. Author", affiliation: "uni-a", email: "[email protected]"),
23-
(name: "X. Writer", affiliation: ("company-b", "third")),
24-
(name: "P. Other", affiliation: "company-b"),
25-
(name: "A. Coauthor", affiliation: ("uni-a", "company-b", "third")),
22+
(name: "C. Author", at: "uni", email: "[email protected]"),
23+
(name: "P. Coauthor", at: ("uni", "third")),
24+
(name: "J. Cockcroft", at: ("INP", "third")),
25+
(name: "C. D. Anderson", at: "INP"),
26+
(names: ("N. Bohr", "A. Einstein", "M. Curie", "E. Lawrence"), at: "INP"),
2627
),
2728
affiliations: (
28-
uni-a: "Town University, City, Country",
29-
company-b: "Paper Company, City, Country",
30-
third: "The Third Institute, City, Country",
29+
uni: "Town University, City, Country",
30+
INP: "Insitute of Nobel Physics, Stockhold, Sweden",
31+
third: [The Third Institute, City, Country],
3132
),
3233
// Funding note (optional, comment out if not applicable)
3334
funding: "Work supported by ...",

thumbnail.webp

-94 KB
Loading

0 commit comments

Comments
 (0)