Skip to content

Commit c2bef9d

Browse files
committed
pandoc 3.8+, latex - Strip LTcaptype definition for captioned longtables
Pandoc 3.8+ wraps uncaptioned longtables with `{\def\LTcaptype{none}...}` to prevent counter increment. When Quarto adds its own caption, this definition conflicts with the caption package causing: "Package caption Error: No float type 'none' defined." Strip the LTcaptype definition while keeping the harmless { } wrapper.
1 parent e40138e commit c2bef9d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/resources/filters/customnodes/floatreftarget.lua‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ end, function(float)
455455
"triggered this error.")
456456
return {}
457457
end
458+
-- Strip Pandoc 3.8+ LTcaptype definition since we're adding our own caption
459+
-- Keep the { } wrapper (harmless) to avoid orphan braces
460+
longtable_preamble = longtable_preamble:gsub("\\def\\LTcaptype{none}[^\n]*\n?", "")
458461
-- split the content into params and actual content
459462
-- params are everything in the first line of longtable_content
460463
-- actual content is everything else

0 commit comments

Comments
 (0)