summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/LaTeX.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-01 02:28:03 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-01 02:28:03 +0000
commit66d2fe3dd2d8dfb28771794aee6118fa5506a9f7 (patch)
treeb64fe47dd51ba528196fe6680a87601d853c8f26 /src/Text/Pandoc/Writers/LaTeX.hs
parentda9eb0760ead057301d870647ed3abff00a9090b (diff)
HTML, LaTeX writer: Don't print header row in headerless table.
Resolves Issue #210. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1856 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Writers/LaTeX.hs')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 4ad55d7a1..f4375ad8c 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -213,13 +213,14 @@ blockToLaTeX (Header level lst) = do
(False, 3) -> text "\\subsubsection" <> stuffing <> char '\n'
_ -> txt <> char '\n'
blockToLaTeX (Table caption aligns widths heads rows) = do
- headers <- tableRowToLaTeX heads
+ headers <- if all null heads
+ then return empty
+ else liftM ($$ text "\\hline") $ tableRowToLaTeX heads
captionText <- inlineListToLaTeX caption
rows' <- mapM tableRowToLaTeX rows
let colDescriptors = concat $ zipWith toColDescriptor widths aligns
let tableBody = text ("\\begin{tabular}{" ++ colDescriptors ++ "}") $$
- headers $$ text "\\hline" $$ vcat rows' $$
- text "\\end{tabular}"
+ headers $$ vcat rows' $$ text "\\end{tabular}"
let centered txt = text "\\begin{center}" $$ txt $$ text "\\end{center}"
modify $ \s -> s{ stTable = True }
return $ if isEmpty captionText