aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-01-04 13:57:41 -0800
committerJohn MacFarlane <[email protected]>2023-01-04 13:57:41 -0800
commit7a82686adcf6efd68b32c5e471b3059be5085165 (patch)
tree19419f47079b351a1f57ae03485452f2fd5987a3 /src
parentc4995fea41c305d94fc929fc1aca165bf6d592d6 (diff)
Use `\toprule\noalign{}` instead of `\toprule()` in LaTeX tables.
And similar for `\midrule` and `\bottomrule`. This facilitates redefining `\toprule`, `\midrule`, and `\bottomrule` without needing to gobble the ()s. Closes #8223.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX/Table.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX/Table.hs b/src/Text/Pandoc/Writers/LaTeX/Table.hs
index 72c20b66e..fe4d0cd75 100644
--- a/src/Text/Pandoc/Writers/LaTeX/Table.hs
+++ b/src/Text/Pandoc/Writers/LaTeX/Table.hs
@@ -58,9 +58,9 @@ tableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do
head' <- do
let mkHead = headToLaTeX blksToLaTeX colCount
case (not $ isEmpty capt, not $ isEmptyHead thead) of
- (False, False) -> return "\\toprule()"
+ (False, False) -> return "\\toprule\\noalign{}"
(False, True) -> mkHead thead
- (True, False) -> return (capt $$ "\\toprule()" $$ "\\endfirsthead")
+ (True, False) -> return (capt $$ "\\toprule\\noalign{}" $$ "\\endfirsthead")
(True, True) -> do
-- avoid duplicate notes in head and firsthead:
firsthead <- mkHead thead
@@ -73,7 +73,7 @@ tableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do
else do
lastfoot <- mapM (rowToLaTeX blksToLaTeX colCount BodyCell) $
footRows tfoot
- pure $ "\\midrule()" $$ vcat lastfoot
+ pure $ "\\midrule\\noalign{}" $$ vcat lastfoot
modify $ \s -> s{ stTable = True }
notes <- notesToLaTeX <$> gets stNotes
return
@@ -83,7 +83,7 @@ tableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do
$$ head'
$$ "\\endhead"
$$ foot'
- $$ "\\bottomrule()"
+ $$ "\\bottomrule\\noalign{}"
$$ "\\endlastfoot"
$$ vcat rows'
$$ "\\end{longtable}"
@@ -184,7 +184,7 @@ headToLaTeX blocksWriter colCount (Ann.TableHead _attr headerRows) = do
rowsContents <-
mapM (rowToLaTeX blocksWriter colCount HeaderCell . headerRowCells)
headerRows
- return ("\\toprule()" $$ vcat rowsContents $$ "\\midrule()")
+ return ("\\toprule\\noalign{}" $$ vcat rowsContents $$ "\\midrule\\noalign{}")
-- | Converts a row of table cells into a LaTeX row.
rowToLaTeX :: PandocMonad m