LaTeX writer: better handling of display math in simple tables.
We convert display math to inline math in simple tables, since LaTeX can't deal with display math in simple tables. Closes #1754.
This commit is contained in:
parent
cb8bb4705f
commit
61d2c2e8cb
1 changed files with 7 additions and 1 deletions
|
@ -545,10 +545,16 @@ fixLineBreaks' ils = case splitBy (== LineBreak) ils of
|
|||
where tohbox ys = RawInline "tex" "\\hbox{\\strut " : ys ++
|
||||
[RawInline "tex" "}"]
|
||||
|
||||
-- We also change display math to inline math, since display
|
||||
-- math breaks in simple tables.
|
||||
displayMathToInline :: Inline -> Inline
|
||||
displayMathToInline (Math DisplayMath x) = Math InlineMath x
|
||||
displayMathToInline x = x
|
||||
|
||||
tableCellToLaTeX :: Bool -> (Double, Alignment, [Block])
|
||||
-> State WriterState Doc
|
||||
tableCellToLaTeX _ (0, _, blocks) =
|
||||
blockListToLaTeX $ walk fixLineBreaks blocks
|
||||
blockListToLaTeX $ walk fixLineBreaks $ walk displayMathToInline blocks
|
||||
tableCellToLaTeX header (width, align, blocks) = do
|
||||
modify $ \st -> st{ stInMinipage = True, stNotes = [] }
|
||||
cellContents <- blockListToLaTeX blocks
|
||||
|
|
Loading…
Add table
Reference in a new issue