diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-12-03 20:55:14 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-12-03 20:55:14 -0800 |
commit | e3d19bf1cd60abd7a1d50e484338491ae4756bf6 (patch) | |
tree | e7891352e8b11b9abc162e8e0443c869fa6b790e /src/Text/Pandoc/Writers | |
parent | bd96f2bdcce55bfe5a7b753d29b3f4a45986f211 (diff) | |
parent | fdaeec0c48d742489ddf0ec0c0261ca9c53f989b (diff) | |
download | pandoc-e3d19bf1cd60abd7a1d50e484338491ae4756bf6.tar.gz |
Merge pull request #1076 from jlduran/booktabs
Add booktabs package for LaTeX tables
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index f3cbcf19f..a2e0b016f 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -453,12 +453,12 @@ blockToLaTeX (Header level (id',classes,_) lst) = blockToLaTeX (Table caption aligns widths heads rows) = do headers <- if all null heads then return empty - else ($$ "\\hline\\noalign{\\medskip}") `fmap` + else ($$ "\\midrule\\endhead") `fmap` (tableRowToLaTeX True aligns widths) heads captionText <- inlineListToLaTeX caption let capt = if isEmpty captionText then empty - else text "\\noalign{\\medskip}" + else text "\\addlinespace" $$ text "\\caption" <> braces captionText rows' <- mapM (tableRowToLaTeX False aligns widths) rows let colDescriptors = text $ concat $ map toColDescriptor aligns @@ -466,10 +466,10 @@ blockToLaTeX (Table caption aligns widths heads rows) = do return $ "\\begin{longtable}[c]" <> braces ("@{}" <> colDescriptors <> "@{}") -- the @{} removes extra space at beginning and end - $$ "\\hline\\noalign{\\medskip}" + $$ "\\toprule\\addlinespace" $$ headers $$ vcat rows' - $$ "\\hline" + $$ "\\bottomrule" $$ capt $$ "\\end{longtable}" @@ -506,7 +506,7 @@ tableRowToLaTeX header aligns widths cols = do (w * scaleFactor))) <> (halign a <> cr <> c <> cr) <> "\\end{minipage}" let cells = zipWith3 toCell widths aligns renderedCells - return $ hsep (intersperse "&" cells) $$ "\\\\\\noalign{\\medskip}" + return $ hsep (intersperse "&" cells) $$ "\\\\\\addlinespace" listItemToLaTeX :: [Block] -> State WriterState Doc listItemToLaTeX lst = blockListToLaTeX lst >>= return . (text "\\item" $$) . |