Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix affiliation bug #77

Merged
merged 7 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that we're supposed to be supporting both flavors of affiliation strings, so I wanted to make sure that the example paper reflected one of each way

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
Loading