quarto-dev / quarto-dev/quarto-cli
JATS XML Generation Doesn't Respect Multiple Author Affiliations
Open
@cscheid is already working on this.
Since Sep 20, 2025.
enhancement
jats
yaml-validation
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
When rendering a Quarto document with multiple authors having different affiliations to JATS XML format, the generated XML incorrectly handles affiliation mapping and organization details.
Steps to reproduce
Minimal Reproducible Example
Create test.qmd:
---
title: "MWE"
format: jats
author:
- name: John Doe
email: john.doe@example.com
affiliations:
- id: ue1
orgname: University of Example
orgdiv1: Department of Example
city: City
country: Country
- name: Jane Smith
email: jane.smith@example.com
affiliations:
- id: ue2
orgname: University of Whatever
orgdiv1: Department of Whatever
city: City
country: Country
---
## Content
Test content.
Render with: quarto render test.qmd
Actual behavior
The generated XML:
- Only creates one
<aff>element despite two different affiliations being defined - Contains empty
<institution/>tags instead of organization details - Maps both authors to the same affiliation ID (
ue1) regardless of their specified affiliations
Problematic Output
The generated XML incorrectly shows:
<contrib-group>
<contrib contrib-type="author">
<!-- John Doe -->
<xref ref-type="aff" rid="ue1">a</xref>
</contrib>
<contrib contrib-type="author">
<!-- Jane Smith -->
<xref ref-type="aff" rid="ue1">a</xref> <!-- Should be ue2 -->
</contrib>
</contrib-group>
<aff id="ue1">
<institution-wrap>
<institution/> <!-- Should contain organization name -->
</institution-wrap>
<city>City</city>
<country>Country</country>
</aff>
<!-- Missing <aff id="ue2"> element -->
Expected behavior
When multiple authors have different affiliations defined in YAML frontmatter, the generated JATS XML should:
- Create separate
<aff>elements for each unique affiliation ID - Include complete organization information (orgname, orgdiv1, etc.)
- Correctly map each author to their specified affiliation via
xrefelements
Expected Output
Should generate:
<contrib-group>
<contrib contrib-type="author">
<!-- John Doe -->
<xref ref-type="aff" rid="ue1">a</xref>
</contrib>
<contrib contrib-type="author">
<!-- Jane Smith -->
<xref ref-type="aff" rid="ue2">b</xref>
</contrib>
</contrib-group>
<aff id="ue1">
<institution-wrap>
<institution>University of Example</institution>
</institution-wrap>
<addr-line>Department of Example</addr-line>
<city>City</city>
<country>Country</country>
</aff>
<aff id="ue2">
<institution-wrap>
<institution>University of Whatever</institution>
</institution-wrap>
<addr-line>Department of Whatever</addr-line>
<city>City</city>
<country>Country</country>
</aff>
Your environment
- Quarto Version: 1.8.24
- Operating System: macOS (Darwin 24.6.0)
- IDE: CLI
Quarto check output
Quarto 1.8.24
[✓] Checking environment information...
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.3.1: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
[✓] Checking tools....................OK
[✓] Checking LaTeX....................OK
[✓] Checking Chrome Headless....................OK
[✓] Checking basic markdown render....OK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.