Skip to content

Commit 7821648

Browse files
committed
Collect author information in a YAML file and use it to render the relevant bits
1 parent 48c3277 commit 7821648

File tree

8 files changed

+113
-21
lines changed

8 files changed

+113
-21
lines changed

.github/workflows/paper.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v4
16+
17+
- name: Install Python requirements
18+
run: pip install -r requirements.txt
19+
20+
- name: Create contributor snippet
21+
run: python contributors.py
1422

1523
- uses: xu-cheng/latex-action@v3
1624
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
contributors.tex
2+
13
## Core latex/pdflatex auxiliary files:
24
*.aux
35
*.lof

contributors.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import jinja2
2+
import os
3+
import yaml
4+
5+
6+
with open("contributors.yml") as f:
7+
data = yaml.safe_load(f)
8+
9+
# Ensure that we have unique indices for the affiliations
10+
affiliations = list()
11+
for authors in data["authors"]:
12+
affiliations.extend(authors.get("affiliations", []))
13+
data["affiliations"] = {aff: i + 1 for i, aff in enumerate(set(affiliations))}
14+
for author in data["authors"]:
15+
author["affiliations"] = [data["affiliations"][aff] for aff in author.get("affiliations", [])]
16+
17+
env = jinja2.Environment(
18+
loader=jinja2.FileSystemLoader(os.getcwd()),
19+
keep_trailing_newline=True,
20+
)
21+
22+
with open("./contributors.tex", "w") as out:
23+
out.write(env.get_template("contributors.tex.j2").render(data=data))

contributors.tex

Whitespace-only changes.

contributors.tex.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{%- for author in data.authors %}
2+
\author[{{ author.affiliations|join(", ") }}]{{ "{" }}{{ author.author }}{{ "}" }}
3+
{%- endfor %}
4+
{%- for affiliation, index in data.affiliations.items() %}
5+
\affil[{{ index }}]{{ "{" }}{{ affiliation }}{{ "}" }}
6+
{%- endfor %}

contributors.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
authors:
2+
- author: "Markus Ankenbrand"
3+
4+
- author: "Bernd Flemisch"
5+
6+
- author: "Florian Goth"
7+
firstName: Florian
8+
lastName: Goth
9+
initials: FG
10+
affiliations:
11+
- Institute for Theoretical Physics and Astrophysics, University of Würzburg, Germany
12+
orcid: 0000-0003-2707-4790
13+
14+
acknowledgements: |
15+
FG acknowledges funding from the Deutsche Forschungsgemeinschaft
16+
(DFG, German Research Foundation) through the SFB 1170 “Tocotronics”,
17+
project Z03 - project number \geprislink{258499086}.
18+
19+
- author: "Jean-Noël Grad"
20+
firstName: Jean-Noël
21+
lastName: Grad
22+
initials: JNG
23+
affiliations:
24+
- Institute for Computational Physics, University of Stuttgart, Germany
25+
orcid: 0000-0002-5821-4912
26+
27+
acknowledgements: |
28+
JNG acknowledges funding from the Deutsche Forschungsgemeinschaft
29+
(DFG, German Research Foundation) - project number \geprislink{391126171}
30+
(PI: Holm) and from the European Union – this work has received funding
31+
from the European High Performance Computing Joint Undertaking (JU) and
32+
countries participating in the project under grant agreement
33+
No [101093169](https://doi.org/10.3030/101093169).
34+
35+
- author: "Dominic Kempf"
36+
firstName: Dominic
37+
lastName: Kempf
38+
initials: DK
39+
affiliations:
40+
- Heidelberg University, Scientific Software Center, Germany
41+
orcid: 0000-0002-6140-2332
42+
43+
acknowledgements: |
44+
DK acknowledges support from the Scientific Software Center which is funded as part
45+
of the Excellence Strategy of the German Federal and State Governments.
46+
47+
- author: "Jan Linxweiler"
48+
firstName: Jan
49+
lastName: Linxweiler
50+
initials: JL
51+
affiliations:
52+
- Technische Universität Braunschweig, Germany
53+
orcid: 0000-0002-2755-5087
54+
55+
56+
- author: "Axel Loewe"
57+
58+
- author: "Frank Löffler"
59+
firstName: Frank
60+
lastName: Löffler
61+
affiliations:
62+
- Friedrich Schiller University Jena, Jena, Germany
63+
- Michael Stifel Center Jena, Jena, Germany
64+
orcid: 0000-0001-6643-6323
65+
66+
67+
- author: "Philipp Schäfer"
68+
69+
- author: "Alexander Struck"

paper.tex

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
\documentclass[a4paper]{article}
2+
\usepackage{authblk}
23
\usepackage[]{biblatex}
34
\usepackage{graphicx}
45
\usepackage{hyperref}
@@ -11,27 +12,8 @@
1112
\addbibresource{bibliography.bib}
1213
\addbibresource{positionpaper.bib}
1314
\title{Establishing RSE departments in German research institutions}
14-
\author{
15-
Bernd Flemisch
16-
\and
17-
Florian Goth
18-
\and
19-
Dominic Kempf
20-
\and
21-
Jan Linxweiler
22-
\and
23-
Frank Löffler
24-
\and
25-
Philipp Schäfer
26-
\and
27-
Alexander Struck
28-
\and
29-
Axel Loewe
30-
\and
31-
Markus Ankenbrand
32-
\and
33-
Jean-Noël Grad
34-
}
15+
16+
\include{contributors.tex}
3517

3618
\date{\today}
3719

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jinja2
2+
pyaml

0 commit comments

Comments
 (0)