aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-01-10 12:28:42 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-01-10 12:28:42 -0800
commitc5ba3b8ee32704f1fdf241480ba64950f8ceedd8 (patch)
tree7e9e923d13594991448558941cd5f8d32c15c675
parent49007ded7b7a64cf9c875f23e9c59a966e1284c8 (diff)
downloadpandoc-c5ba3b8ee32704f1fdf241480ba64950f8ceedd8.tar.gz
LaTeX reader: fix inconsistent column widths.
This fixes a bug whereby column widths for the body were different from widths for the header in some tables. Closes #4238.
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 296b30ee1..49b39f014 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -749,9 +749,9 @@ tableRowToLaTeX header aligns widths cols = do
isSimple [] = True
isSimple _ = False
-- simple tables have to have simple cells:
- let widths' = if not (all isSimple cols)
+ let widths' = if all (== 0) widths && not (all isSimple cols)
then replicate (length aligns)
- (0.97 / fromIntegral (length aligns))
+ (scaleFactor / fromIntegral (length aligns))
else map (scaleFactor *) widths
cells <- mapM (tableCellToLaTeX header) $ zip3 widths' aligns cols
return $ hsep (intersperse "&" cells) <> "\\tabularnewline"