Repository navigation
Conversation
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
EnochxynL
marked this pull request as ready for review
October 27, 2026 02:13
EnochxynL
marked this pull request as draft
October 27, 2026 02:15
EnochxynL
marked this pull request as ready for review
October 27, 2026 05:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related to #14846.
Markdown tables in
classoption: twocolumndocuments currently producelongtable, which fails during PDF compilation. Upgrade the bundled Pandoc to3.10.1 and automatically use its
.floatclass for ordinary native tables,including cross-referenced tables. Single-column documents retain the existing
default and can opt into
.floatindividually. For floating cross-referencedtables,
tbl-possupplies the placement unlesslatex-placementis explicitly set.Extend native table layouts to full-width and margin tables, bottom captions,
and unlabelled panel tables. Pandoc serializes the complete table body, preserving
widths, merged cells, citations, and table notes; Quarto supplies the enclosing
environment and captions where needed.
When loading
sidenotes, preserve both the document class's nativetable*andfigure*definitions and the package's margin-wide versions. Select between themat use time so double-column floats retain their full text width, including
documents that switch columns in the body.
Automatic selection uses explicit
classoption: twocolumn; it does not inferunknown journal-class defaults or parse arbitrary column-switching commands.
Such documents can explicitly use
.floator a full-width layout class.Existing raw
longtableconversion paths remain outside this change.Validation
tests/smoke/crossref/tables-float.test.tsandtests/smoke/crossref/latex.test.tspass.captions, column switching, citations, and notes. Runtime dimension assertions
check that double-column floats retain the full text width.
.float, placementprecedence, widths, merged cells, and avoidance of nested table floats.
deno fmt --checkfor the changed TypeScript andgit diff --checkpass.Additional local validation used four arXiv documents with the project's Markdown
table serializer disabled. An adapter mapped its layout settings to native Quarto
attributes; the independent HTML-table converter remained enabled. All four
compiled, retained their page counts (23 / 7 / 50 / 25), and preserved all 36
table-label numbers. Extracted PDF text matched the baseline after removing
whitespace, with no unresolved references or increase in overflow warnings.
Ara supplies five native Markdown tables; the other papers primarily exercise raw
LaTeX passthrough. These local benchmark artifacts are not included in this PR;
the synthetic regression fixtures are included.
Checklist
I have (if applicable):
The issue is associated with this PR; automatic closure is left for maintainers
to confirm after reviewing its scope. All automated checks on the latest PR revision pass. The complete repository test suite has not been run locally. No website documentation PR has been created.
AI-assisted PR
GitHub issue Support Pandoc's .float table class to avoid longtable in twocolumn layouts #14846, related Quarto discussions, and Pandoc 3.10.1 release notes
and writer source.
Human Review
Original Issue
jgm/pandoc#1023
By default, Pandoc outputs tables as
longtable(used in LaTeX for typesetting long tables that span pages). This works for single-column documents, but for two-column documents LaTeX'slongtabledoes not support two columns, so it reports:In 2026, Pandoc 3.10.1 added another output: an ordinary
table+tabular(native LaTeX uses thetableenvironment for floating tables andtabularfor table content; spanning both columns requirestable*); the position is specified vialatex-placement. This approach supports two-column documents ("supports two columns" does not mean "must float". It is just that Pandoc's.floatinterface chooses to provide the combinationtable+tabular). To enable it, add.floatto the table; issue 1023 was closed accordingly.#14846
The Quarto issue also points out this problem and notes:
.float.longtable. Therefore, one cannot simply add.floatto all tables; those paths must also be adapted.https://github.com/Selbosh/aaai2026-quarto
This repository template handles the same class of problem, but the patch is simplified:
table[ht]and does not fully handletable*spanning both columns.stringify()to flatten cells and captions into text, which loses bold, links, and other structures.Changed Functionality
latex_table_floats(): automatically determines which tables should automatically be given the.floatmarker. It does not generate LaTeX table code.classoptionand determine whether the document explicitly enablestwocolumn. If not, do not automatically modify tables.tablefloating environment is generated inside them, illegal nesting may occur..floatto ordinary standalone tables. Handle two internal representations at the same time: nativeTable, and referenced tables wrapped by Quarto asFloatRefTarget.customnodes/floatreftarget.lua: if.floatis present, pass thefigPosvariable that Quarto parses fromtbl-posintolatex-placementfor positioning (an existing explicitlatex-placementtakes precedence and will not be overwritten).layout/latex.lua: rewritelatexTabular()(the function that obtains table content).complete Pandoc Table → to_simple_table → Lua manual concatenation → tabular. This approach makes it difficult to preserve column widths, merged cells, and complex cell content.copy of complete Pandoc Table → add .float → Pandoc generates table + tabular → remove outer table → leave table content for Quarto layout. Specifically, this includes:.floatand call Pandoc's LaTeX writer.tablegenerated by Pandoc.tabularoutput such as column widths, row spans, and column spans.multirowpackage needed for merged rows.latexWriteTable(): when generating LaTeX in advance, use placeholders to preserve the opportunity for subsequent bibliography citation processing.latexTableNoteEnvironment(): addsavenoteswhen necessary to avoid losing footnote text in tables.customnodes/floatreftarget.lua: handling of complex tables with captions and references. For special environments such as cross-column and margin environments, or bottom-captioned tables with.float, the outer environment and caption are controlled by Quarto; ordinary single-column bottom-captioned tables without the.floatmarker keep the originallongtablepath. New handling includes:latexTabular()to obtain the table content;marginfiguretomargintable;latex-placement;.floattable generating anothertable;handle_table_columns(): handling of layout tables that do not go through the reference-object path. If margin or cross-column attributes are checked first, anothermargintableenvironment may be wrapped, so prioritize recognizing therender-as-tabularlayout marker.latexTabular()withtable*.margintable.tabularto avoid residuallongtableinside the outer layout.longtablewas retained, comment markers were added, and then TypeScript modified the column widths; now, the layout environment andtabularare generated directly. Therefore, the originalbeginColumnComment()andendColumnComment()functions are no longer needed. The accompanying TypeScript processor (tableColumnMarginLineProcessor()insrc\format\pdf\format-pdf.ts) is no longer triggered in the current built-in path and is temporarily retained, leaving it to the maintainers to decide whether to clean it up.layout/meta.lua: avoidsidenotesbreaking two-column floats. When Quarto uses margin layout, it loadssidenotes, but this package redefinestable*andfigure*. Its definitions are suitable for layouts that expand into the margin in single-column documents; in two-column documents, however, they may cause floats that should span two columns to have incorrect widths. Dynamically select when used:preserve_markdown_code_languages(): a new problem in Pandoc 3.10.1. It no longer treats any ordinary class as a language name, but still recognizes explicitlanguage-*markers.tests/docs/smoke-all/markdown/definition-list/definition-list-div.qmd: modify the test assertion. For a Typst syntax, the old test, according to the code form generated by Pandoc 3.10, required/ Inner term: #block[to appear. After the upgrade, the interpreted content still exists, but the wrapper is omitted, becoming the compact text/ Inner term: Inner definition., so the assertion fails. We changed the assertion to/ Inner term:\s*(?:#block\[\s*)?Inner definition\.so that the test is compatible with the behavior of Pandoc 3.10.1.