diff --git a/CHANGELOG.md b/CHANGELOG.md index 3875bbd..92637cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ `Inara` uses [SemVer][] (semantic versioning). +## Inara v1.1.2 + +- Fix bug in application of `prepare-affiliations.lua` filter (Charles Tapley Hoyt) + ## Inara v1.1.1 Released 2024-09-05. diff --git a/data/filters/prepare-affiliations.lua b/data/filters/prepare-affiliations.lua index cf00da5..d678c5d 100644 --- a/data/filters/prepare-affiliations.lua +++ b/data/filters/prepare-affiliations.lua @@ -7,9 +7,9 @@ local function perepare_affiliations (meta) -- and meta.author (the processed one) for _, author in ipairs(meta.authors or {}) do local xml = "" - for i, affiliation_list in ipairs(author.affiliation) do - local index = tonumber(affiliation_list[1].text) - local affiliation = meta.affiliations[index] + for i, affiliation_index in ipairs(author.affiliation) do + affiliation_index = tonumber(pandoc.utils.stringify(affiliation_index)) + local affiliation = meta.affiliations[affiliation_index] xml = xml.. "\n " for _, v in ipairs(affiliation.name) do if v.text then diff --git a/example/paper.md b/example/paper.md index 043882b..9c2e3fc 100644 --- a/example/paper.md +++ b/example/paper.md @@ -4,7 +4,7 @@ title: >- authors: - name: Albert Krewinkel email: albert@zeitkraut.de - affiliation: [1, 2, 4] + affiliation: "1, 2, 4" orcid: 0000-0002-9455-0796 corresponding: true - name: Juanjo Bazán diff --git a/test/expected-draft/paper.preprint.tex b/test/expected-draft/paper.preprint.tex index b61a918..f1d25d1 100644 --- a/test/expected-draft/paper.preprint.tex +++ b/test/expected-draft/paper.preprint.tex @@ -160,7 +160,7 @@ \usepackage{orcidlink} %% \renewcommand\Authsep{, } \setlength{\affilsep}{1em} -\author[1,2% +\author[1,2,4% % \ensuremath\mathparagraph]{Albert Krewinkel% \,\orcidlink{0000-0002-9455-0796}\,% @@ -179,6 +179,9 @@ \affil[1]{Open Journals} \affil[2]{Pandoc Development Team} \affil[3]{GitHub} +\affil[4]{Technische Universitaet Hamburg% + \,\protect\href{https://ror.org/04bs1pb34}{\protect\rorlogo}\,% + } \affil[$\mathparagraph$]{Corresponding author: % albert@zeitkraut.de % } diff --git a/test/expected-pub/paper.preprint.tex b/test/expected-pub/paper.preprint.tex index b61a918..f1d25d1 100644 --- a/test/expected-pub/paper.preprint.tex +++ b/test/expected-pub/paper.preprint.tex @@ -160,7 +160,7 @@ \usepackage{orcidlink} %% \renewcommand\Authsep{, } \setlength{\affilsep}{1em} -\author[1,2% +\author[1,2,4% % \ensuremath\mathparagraph]{Albert Krewinkel% \,\orcidlink{0000-0002-9455-0796}\,% @@ -179,6 +179,9 @@ \affil[1]{Open Journals} \affil[2]{Pandoc Development Team} \affil[3]{GitHub} +\affil[4]{Technische Universitaet Hamburg% + \,\protect\href{https://ror.org/04bs1pb34}{\protect\rorlogo}\,% + } \affil[$\mathparagraph$]{Corresponding author: % albert@zeitkraut.de % }