Skip to content

JATS: footnotes in table-wrap-foot and author-notes are dropped #4796

Open

Description

@matssun

Bug

A follow-up to #3583. #3636 converts <fn> inside an <fn-group>, and #4361 keeps their styling. Footnotes elsewhere are not converted. fn-group is the only footnote handling in _walk_linear (jats_backend.py#L1343-L1349 at v2.138.0). Two common places are affected:

  • table-wrap-foot/fn: table footnotes. These often carry the abbreviations and significance markers the table needs. One PLOS article we checked has 11; none is converted.
  • article-meta/author-notes/fn: conflict-of-interest and author-contribution notes.

Minimal input (after the prologue):

<front><article-meta><title-group><article-title>Control</article-title></title-group>
<author-notes><fn fn-type="conflict" id="an1"><p>ECHO-AUTHOR-NOTE text.</p></fn></author-notes>
</article-meta></front>
<body><sec><title>S</title>
<table-wrap id="t1"><label>Table 1</label><caption><p>Echo table.</p></caption>
<table><tr><th>H</th></tr><tr><td>ECHO-CELL</td></tr></table>
<table-wrap-foot><fn id="tf1"><p>ECHO-TABLE-FOOT text.</p></fn></table-wrap-foot></table-wrap>
</sec></body>
<back><fn-group><fn id="fg1"><p>ECHO-FN-GROUP text.</p></fn></fn-group></back>
</article>

Observed on v2.138.0 (a76ae4b6) and on main (f0d90989), unchanged since 2.131.0:

  • ECHO-FN-GROUP and the table cell are converted;
  • ECHO-TABLE-FOOT and ECHO-AUTHOR-NOTE appear nowhere in export_to_dict().

For table footnotes, would the table's footnotes (as with captions) be the right place? We can contribute fixtures and tests.

Steps to reproduce

Save the article as article.xml, then:

from docling.document_converter import DocumentConverter
doc = DocumentConverter().convert("article.xml").document
print(doc.export_to_markdown())
print([(t.text, t.hyperlink) for t in doc.texts])

Every article starts with this prologue. The backend needs a DOCTYPE.

<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" article-type="research-article">

Docling version

v2.138.0 (a76ae4b6) and main (f0d90989), each installed as docling-slim[standard] from git.

Python version

3.14.7

Activity

  1. AryanRG commented on Oct 13, 2026

    @AryanRG

    Hi, I’ve prepared a local fix for table-wrap-foot/fn that keeps each note attached to its table in source order, preserving formatting, links, formulas and citation text. Author notes and fn-group handling are unchanged.

    I’ve added 13 synthetic regression tests covering ownership, ordering, rich content, JSON round trips and export placement. The parser and local core changes have passed independent local review.

    There’s a separate export dependency: docling-core 2.100.0 drops simple table notes from Markdown/HTML, while rich content can appear outside the footnote slot. The passing export tests use an unpublished local adaptation of core #675 by @Kavishkagaya, with rich-content and exclusion fixes. Core #545 by @M-Hassan-Raza also informed the validation. The parser patch isn’t ready against the unchanged released dependency.

    Is this table-owned representation the direction you’d prefer? How would you like the parser change coordinated with the existing core PRs? @matssun, have you started the fixture/test work you offered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions