@@ -26,7 +26,8 @@ import Text.DocLayout
26 ( Doc, braces, cr, empty, hcat, hsep, isEmpty, literal, nest
26 ( Doc, braces, cr, empty, hcat, hsep, isEmpty, literal, nest
27 , text, vcat, ($$) )
27 , text, vcat, ($$) )
28import Text.Pandoc.Shared (blocksToInlines, splitBy, tshow)
28import Text.Pandoc.Shared (blocksToInlines, splitBy, tshow)
29−import Text.Pandoc.Walk (walk)
29+import Text.Pandoc.Walk (walk, query)
30+import Data.Monoid (Any(..))
30import Text.Pandoc.Writers.LaTeX.Caption (getCaption)
31import Text.Pandoc.Writers.LaTeX.Caption (getCaption)
31import Text.Pandoc.Writers.LaTeX.Notes (notesToLaTeX)
32import Text.Pandoc.Writers.LaTeX.Notes (notesToLaTeX)
32import Text.Pandoc.Writers.LaTeX.Types
33import Text.Pandoc.Writers.LaTeX.Types
@@ -261,8 +262,12 @@ cellToLaTeX blockListToLaTeX celltype annotatedCell = do
261 Para{} -> True
262 Para{} -> True
262 Plain{} -> True
263 Plain{} -> True
263 _ -> False
264 _ -> False
265+ let hasLineBreak LineBreak = Any True
266+ hasLineBreak _ = Any False
264 result <-
267 result <-
265− if not hasWidths || (celltype /= HeaderCell && all isPlainOrPara blocks)
268+ if not hasWidths || (celltype /= HeaderCell
269+ && all isPlainOrPara blocks
270+ && not (getAny (query hasLineBreak blocks)))
267 blockListToLaTeX $ walk fixLineBreaks $ walk displayMathToInline blocks
272 blockListToLaTeX $ walk fixLineBreaks $ walk displayMathToInline blocks