aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-28 08:53:54 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-28 08:53:54 -0800
commit90296d7e96de6c8a36192c6eb12b4cc42b673d1e (patch)
treed1249867f654657e9d7af9889d90d4f72720f351 /src/Text/Pandoc/Writers
parent3c93ac5cf0995cc2dd8bb5775029da550af61e0d (diff)
downloadpandoc-90296d7e96de6c8a36192c6eb12b4cc42b673d1e.tar.gz
LaTeX writer: Use \endhead after \toprule in headerless tables.
Closes #4207.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index d6ccc1512..87ce65586 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -699,10 +699,9 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
then return empty
else ($$ text "\\endfirsthead") <$> toHeaders heads
head' <- if all null heads
- then return empty
+ then return "\\toprule"
-- avoid duplicate notes in head and firsthead:
- else ($$ text "\\endhead") <$>
- toHeaders (if isEmpty firsthead
+ else toHeaders (if isEmpty firsthead
then heads
else walk removeNote heads)
let capt = if isEmpty captionText
@@ -717,8 +716,8 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
-- the @{} removes extra space at beginning and end
$$ capt
$$ firsthead
- $$ (if all null heads then "\\toprule" else empty)
$$ head'
+ $$ "\\endhead"
$$ vcat rows'
$$ "\\bottomrule"
$$ "\\end{longtable}"