Skip to content

Commit

Permalink
Fix affiliation bug (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt authored Sep 16, 2024
1 parent 1d6d50e commit f96dcaa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions data/filters/prepare-affiliations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<affiliations>"
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 <institution><institution_name>"
for _, v in ipairs(affiliation.name) do
if v.text then
Expand Down
2 changes: 1 addition & 1 deletion example/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: >-
authors:
- name: Albert Krewinkel
email: [email protected]
affiliation: [1, 2, 4]
affiliation: "1, 2, 4"
orcid: 0000-0002-9455-0796
corresponding: true
- name: Juanjo Bazán
Expand Down
5 changes: 4 additions & 1 deletion test/expected-draft/paper.preprint.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}\,%
Expand All @@ -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: %
[email protected] %
}
Expand Down
5 changes: 4 additions & 1 deletion test/expected-pub/paper.preprint.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}\,%
Expand All @@ -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: %
[email protected] %
}
Expand Down

0 comments on commit f96dcaa

Please sign in to comment.