diff options
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Writers/LaTeX/Table.hs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX/Table.hs b/src/Text/Pandoc/Writers/LaTeX/Table.hs index 1d9b117ca..ee5c62a3b 100644 --- a/src/Text/Pandoc/Writers/LaTeX/Table.hs +++ b/src/Text/Pandoc/Writers/LaTeX/Table.hs @@ -47,11 +47,13 @@ tableToLaTeX :: PandocMonad m tableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do let (Ann.Table (ident, _, _) caption specs thead tbodies tfoot) = tbl CaptionDocs capt captNotes <- captionToLaTeX inlnsToLaTeX caption ident - let isSimpleTable = all (all isSimpleCell) $ mconcat - [ headRows thead - , concatMap bodyRows tbodies - , footRows tfoot - ] + let isSimpleTable = + all ((== ColWidthDefault) . snd) specs && + all (all isSimpleCell) + (mconcat [ headRows thead + , concatMap bodyRows tbodies + , footRows tfoot + ]) let removeNote (Note _) = Span ("", [], []) [] removeNote x = x let colCount = ColumnCount $ length specs @@ -111,12 +113,14 @@ tableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do isSimpleCell :: Ann.Cell -> Bool isSimpleCell (Ann.Cell _ _ (Cell _attr _align _rowspan _colspan blocks)) = case blocks of - [Para _] -> True - [Plain _] -> True + [Para _] -> not (hasLineBreak blocks) + [Plain _] -> not (hasLineBreak blocks) [] -> True _ -> False - - + where + hasLineBreak = getAny . query isLineBreak + isLineBreak LineBreak = Any True + isLineBreak _ = Any False -- | Total number of columns in a table. newtype ColumnCount = ColumnCount Int |
