aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-03-14 18:42:59 -0700
committerJohn MacFarlane <[email protected]>2025-03-14 18:42:59 -0700
commit4bf3a735f5eb9c31d3ab737ee89a21e87a1962d9 (patch)
tree9fd3eeb04021593f44bba90848464e973be91ac2 /src
parent28eca1e41e32a4f76645df6ea6de4f746a9e3e62 (diff)
LaTeX writer: use `*` for multirow width when no colwidth specified.
Otherwise the multirow will be excessively wide. Closes #10685.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX/Table.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX/Table.hs b/src/Text/Pandoc/Writers/LaTeX/Table.hs
index 47e178537..34d655d62 100644
--- a/src/Text/Pandoc/Writers/LaTeX/Table.hs
+++ b/src/Text/Pandoc/Writers/LaTeX/Table.hs
@@ -366,11 +366,15 @@ cellToLaTeX blockListToLaTeX isSimpleTable colCount celltype annotatedCell = do
<> braces (literal colDescr)
<> braces ("%\n" <> x)
-- linebreak for readability
+ let hasColWidths = not (all (== ColWidthDefault) colWidths)
let inMultiRow x = case rowspan of
(RowSpan 1) -> x
(RowSpan n) -> let nrows = literal (tshow n)
in "\\multirow" <> braces nrows
- <> braces "=" -- width of column
+ <> braces -- width of column
+ (if hasColWidths
+ then "=" -- max width
+ else "*") -- natural width
<> braces x
return . inMultiColumn . inMultiRow $ result