Skip to content

Export to JATS-family XML (JATS and BITS) #8895

Open

Description

@domoritz

Description

Add an export target for JATS XML (ANSI/NISO Z39.96), with BITS as a follow-on.

JATS is the standard XML format for journal articles. BITS extends JATS for books (chapters, parts, book front matter).

Suggested scope

  • Map document structure to JATS: sections, paragraphs, lists, figures, tables, footnotes, cross-references, and math (as MathML).
  • Map document metadata (title, authors, affiliations, abstract, keywords) to <front>.
  • Output bibliography entries as structured <ref> elements.
  • Let users add JATS-specific metadata that has no Typst equivalent (for example, article type or journal metadata), for example through metadata or a set rule.
  • Later: BITS output for book-length documents.

This could build on the same semantic output work as HTML export (#5512).

References

Use Case

Many journals and archives require JATS XML as part of their internal formats. With JATS export, they could adopt Typst as a production tool, with PDF and JATS from one source. See also #3799 (comment).

Activity

  1. added
    feature request
    on Sep 26, 2026
  2. Enivex commented on Sep 26, 2026

    @Enivex
    Collaborator

    Many journals and archives require JATS XML for submission, archiving, and indexing

    I have literally never heard of any journal requiring this. The journal may convert the source behind the scenes, but not the author.

  3. domoritz commented on Sep 26, 2026

    @domoritz
    Author

    I reworded the use case.

  4. cady-b commented on Sep 26, 2026

    @cady-b
    Contributor

    I'm fairly certain for the conceivable future, the core Typst project should rather focus on supporting a small set of widely used formats well than a breadth of formats sparsely.

    Wouldn't it be simple enough to process HTML output into usable JATS with a small harness, given that pandoc already supports it / with additional data from typst eval?

  5. domoritz commented on Sep 29, 2026

    @domoritz
    Author

    JATS/BITS support is blocking adoption by journals and it seems pretty widely used. I agree Typst should focus but this may be an extension that's worth it so that more journals/conferences can accept papers written in Typst. Yes, authors usually do not submit JATS. However, publishers convert submissions to JATS in their production pipelines, and those pipelines only accept Word and LaTeX right now. As long as there is no reliable path from Typst to JATS, a journal cannot accept Typst submissions.

    Wouldn't it be simple enough to process HTML output into usable JATS with a small harness, given that pandoc already supports it / with additional data from typst eval?

    typst eval is a cool idea I hadn't thought of. It could be okay for a prototype but doesn't solve the problem of getting semantic front matter (affiliations, funding, corresponding author) out of templates. A built-in output target for hats/bits would (or at least a standard convention for templates to expose the metadata) would be much cleaner.

  6. reknih commented on Sep 29, 2026

    @reknih
    Member

    We agree that exporting to JATS should be achievable.

    To give a bit of background on the use case: Many publishers run or are aiming to establish single-source publishing workflows. This means that they want to store all manuscripts in a single format internally and then generate print, web, and eBook versions from that on demand. Author manuscripts need to be converted from their format to the single internal format, no matter whether they have arrived in LaTeX, Word, Markdown, or Typst. Once they have that single, standardized file, they can use tools to format it on demand. Ingesting JATS files and rendering these final deliverables is possible with Typst today, see the last paragraph for more on this.

    Publishers currently achieve conversion of author manuscripts to JATS or their chosen storage format using a mixture of Pandoc, custom scripts that break easily, and manual labor, most often off-shored.

    If Typst was able to output correct and uniform JATS without custom tooling, publishers who already run a JATS single-source publishing pipeline would be able to accept Typst manuscripts without any investment. If journals decide to only accept Typst manuscripts, they can eliminate their off-shored workforce and custom tooling altogether, and thus a large cost center. These are economic incentives to allow authors to also or only submit in Typst.

    From a technical standpoint, we are currently evolving the Typst compiler to accept additional export formats as self-contained crates (cf. #3304). This work is coupled to HTML export. For JATS, this would allow us or the community to maintain an experimental JATS exporter that can be used by building a custom Typst binary including it.

    In the long-term, I see a few options for JATS support:

    • A fully supported export target shipping with the Typst compiler, like paged and HTML
    • A crate maintained by us or the community providing an export target
    • A Pandoc AST export target that aims to export Typst to the maximum fidelity to Pandoc, so users can choose any of Pandoc's backends instead of being bound to JATS (cf. Implement pandoc output (and thus indirectly Markdown, HTML, ePub, docx output) #461 and linked Pandoc PRs)
    • Some generic XML target shipping with the Typst compiler, with JATS specifics handled by user-space code
    • JATS export implemented entirely in user-space (Typst or WASM plugin) by leveraging future content traversal APIs and bundle export

    The Pandoc export in particular would trade some JATS fidelity for support for more formats as JATS is popular but not dominant as a storage format for publishers.

    Finally, Typst is a member of the Single-Source Publishing Community and has presented at their meetup on a similar topic, outputting print and websites from stored JATS and bypassing JATS entirely for Typst manuscripts. I have attached our slides. A proof-of-concept for ingesting JATS in Typst can be found there.

    Single-Source Publishing Meetup Slides

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

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions