aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-03-12 11:06:49 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-03-12 11:06:49 -0700
commit60fb915351c22bea339dbce503a03c691c793f6b (patch)
treebe1e9c3d27780a385b37219e2b8ea9155fd74cca
parent1202f016bbb109e780587477024d8c3ae31d55a3 (diff)
downloadpandoc-60fb915351c22bea339dbce503a03c691c793f6b.tar.gz
Use {} around ctable caption. Closes #445.
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs2
-rw-r--r--tests/tables.latex6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 55275e046..0a6f8669c 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -372,7 +372,7 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
captionText <- inlineListToLaTeX caption
let capt = if isEmpty captionText
then empty
- else text "caption = " <> captionText <> "," <> space
+ else text "caption = {" <> captionText <> "}," <> space
rows' <- mapM (tableRowToLaTeX False aligns widths) rows
let rows'' = intersperse ("\\\\\\noalign{\\medskip}") rows'
tableNotes <- liftM (reverse . stTableNotes) get
diff --git a/tests/tables.latex b/tests/tables.latex
index 21ad73b0a..7025452ae 100644
--- a/tests/tables.latex
+++ b/tests/tables.latex
@@ -1,6 +1,6 @@
Simple table with caption:
-\ctable[caption = Demonstration of simple table syntax.,
+\ctable[caption = {Demonstration of simple table syntax.},
pos = H, center, botcap]{rlcl}
{% notes
}
@@ -35,7 +35,7 @@ Right & Left & Center & Default
Simple table indented two spaces:
-\ctable[caption = Demonstration of simple table syntax.,
+\ctable[caption = {Demonstration of simple table syntax.},
pos = H, center, botcap]{rlcl}
{% notes
}
@@ -53,7 +53,7 @@ Right & Left & Center & Default
Multiline table with caption:
-\ctable[caption = Here's the caption. It may span multiple lines.,
+\ctable[caption = {Here's the caption. It may span multiple lines.},
pos = H, center, botcap]{clrl}
{% notes
}