Skip to content

RFC: Represent citation locators structurally in the Pandoc AST #11820

Description

@dereuromark

Describe your proposed improvement and the problem it solves.

Pandoc currently stores a citation locator as part of citationSuffix:

[@doe, p. 33]

The AST retains roughly , p. 33, but not that page is the locator label and 33 is its value. Citeproc can parse this convention again, but filters and format bridges cannot inspect or change the locator reliably without parsing formatted inline content.

Could Citation gain optional structured locator information, such as a label and inline value? Readers could populate it when the source format provides that structure, and citeproc could continue accepting the existing suffix convention for compatibility.

This came up while mapping Carve citations, but it would also help CSL JSON, JATS, DOCX and other structured citation formats.

Describe alternatives you've considered.

We preserve the visible locator in citationSuffix and have since added private round-trip metadata carrying the typed label and value, keeping a native Cite alongside it so citeproc still processes the citation normally. That keeps output working and round-trips our own documents, but it does not give Pandoc filters an interoperable representation - a filter would have to know our private encoding to read a locator, which is the thing worth avoiding.

I realize changing pandoc-types has a high compatibility cost. I am opening this mainly to establish whether structured locators belong in the AST before attempting a concrete API proposal.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions