aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX/Table.hs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX/Table.hs b/src/Text/Pandoc/Writers/LaTeX/Table.hs
index 7298acd5c..38ba60764 100644
--- a/src/Text/Pandoc/Writers/LaTeX/Table.hs
+++ b/src/Text/Pandoc/Writers/LaTeX/Table.hs
@@ -330,20 +330,15 @@ multicolumnDescriptor align
width = sum $ NonEmpty.map toWidth colWidths
-- no column separators at beginning of first and end of last column.
- numseps = (case colnum + 1 of
- 1 -> 0 -- Not sure why this case is needed (tarleb)
- _ -> -- the final cell has only one tabcolsep
- if colnum + colspan == numcols
- then 1
- else 2) :: Int
skipColSep = "@{}" :: String
in T.pack $
- printf "%s>{%s\\arraybackslash}p{%0.4f\\columnwidth - %d\\tabcolsep}%s"
+ printf "%s>{%s\\arraybackslash}p{(\\columnwidth - %d\\tabcolsep) * \\real{%0.4f} + %d\\tabcolsep}%s"
(if colnum == 0 then skipColSep else "")
(T.unpack (alignCommand align))
+ (2 * (numcols - 1))
width
- numseps
- (if colnum + colspan == numcols then skipColSep else "")
+ (2 * (colspan - 1))
+ (if colnum + colspan >= numcols then skipColSep else "")
-- | Perform a conversion, assuming that the context is a minipage.
inMinipage :: Monad m => LW m a -> LW m a