summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2023-02-22 09:21:35 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2023-02-22 09:26:26 +0100
commit0088b776bc051e6428ab53856d12d5836b0fc721 (patch)
tree994119cfaacc3551588c789df194d03cb492ba7e /src/Text
parent9c39d1632ea9dfd0ff12f15a555baf5b15143274 (diff)
LaTeX writer: do not use longtable foot with Beamer
The table foot is made part of the table body, as otherwise it won't show up in the output. The root cause for this is that longtable cannot detect page breaks in Beamer. Fixes: #8638
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX/Table.hs20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX/Table.hs b/src/Text/Pandoc/Writers/LaTeX/Table.hs
index 773c65985..63683f79f 100644
--- a/src/Text/Pandoc/Writers/LaTeX/Table.hs
+++ b/src/Text/Pandoc/Writers/LaTeX/Table.hs
@@ -76,16 +76,28 @@ tableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do
pure $ "\\midrule\\noalign{}" $$ vcat lastfoot
modify $ \s -> s{ stTable = True }
notes <- notesToLaTeX <$> gets stNotes
+ beamer <- gets stBeamer
return
$ "\\begin{longtable}[]" <>
braces ("@{}" <> colDescriptors tbl <> "@{}")
-- the @{} removes extra space at beginning and end
$$ head'
$$ "\\endhead"
- $$ foot'
- $$ "\\bottomrule\\noalign{}"
- $$ "\\endlastfoot"
- $$ vcat rows'
+ $$ vcat
+ -- Longtable is not able to detect pagebreaks in Beamer; this
+ -- causes problems with the placement of the footer, so make
+ -- footer and bottom rule part of the body when targeting Beamer.
+ -- See issue #8638.
+ (if beamer
+ then [ vcat rows'
+ , foot'
+ , "\\bottomrule\\noalign{}"
+ ]
+ else [ foot'
+ , "\\bottomrule\\noalign{}"
+ , "\\endlastfoot"
+ , vcat rows'
+ ])
$$ "\\end{longtable}"
$$ captNotes
$$ notes