aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-07-10 13:06:41 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-07-10 13:06:41 -0700
commit66378062b622b0815a1a2ddce5d557e3ad13330c (patch)
tree677c7d8193046c4ef517ba2b52123aa4bbbcef57 /src/Text/Pandoc
parent7d6da118d30c8682d64ee10c99259ac69c34b5be (diff)
downloadpandoc-66378062b622b0815a1a2ddce5d557e3ad13330c.tar.gz
LaTeX writer: Put table captions above tables.
The standard seems to be captions above tables. (See http://tex.stackexchange.com/questions/3243/why-should-a-table-caption-be-placed-above-the-table)
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 100bf900d..5bbe30fc8 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -471,19 +471,18 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
captionText <- inlineListToLaTeX caption
let capt = if isEmpty captionText
then empty
- else text "\\addlinespace"
- $$ text "\\caption" <> braces captionText
+ else text "\\caption" <> braces captionText <> "\\\\"
rows' <- mapM (tableRowToLaTeX False aligns widths) rows
let colDescriptors = text $ concat $ map toColDescriptor aligns
modify $ \s -> s{ stTable = True }
return $ "\\begin{longtable}[c]" <>
braces ("@{}" <> colDescriptors <> "@{}")
-- the @{} removes extra space at beginning and end
+ $$ capt
$$ "\\toprule\\addlinespace"
$$ headers
$$ vcat rows'
$$ "\\bottomrule"
- $$ capt
$$ "\\end{longtable}"
toColDescriptor :: Alignment -> String