aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorNils Carlson <nils.carlson@ludd.ltu.se>2019-09-21 20:12:00 +0000
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-24 15:23:59 -0700
commit8028de33220af0a43ac8d14021b7fa2b98b22d64 (patch)
tree3f414a7a173669d83b766a10b1760db96daf5541 /src/Text/Pandoc/Writers
parent251e2b2d6d4310aa22f3575db371c6c1cfa909af (diff)
downloadpandoc-8028de33220af0a43ac8d14021b7fa2b98b22d64.tar.gz
odt: Add external option for native numbering
This adds an external options +native_numbering to the ODT writer enabling enumeration of figures and tables in ODT output.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index 3da778ae9..7a3aa4973 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -397,9 +397,9 @@ blockToOpenDocument o bs
captionDoc <- if null c
then return empty
else inlinesToOpenDocument o c >>=
- if True -- temporary: see #5474
- then unNumberedCaption "TableCaption"
- else numberedTableCaption
+ if isEnabled Ext_native_numbering o
+ then numberedTableCaption
+ else unNumberedCaption "TableCaption"
th <- if all null h
then return empty
else colHeadsToOpenDocument o (map fst paraHStyles) h
@@ -412,9 +412,9 @@ blockToOpenDocument o bs
| otherwise = do
imageDoc <- withParagraphStyle o "FigureWithCaption" [Para [Image attr caption (source,title)]]
captionDoc <- inlinesToOpenDocument o caption >>=
- if True -- temporary: see #5474
- then unNumberedCaption "FigureCaption"
- else numberedFigureCaption
+ if isEnabled Ext_native_numbering o
+ then numberedFigureCaption
+ else unNumberedCaption "FigureCaption"
return $ imageDoc $$ captionDoc
@@ -423,7 +423,7 @@ numberedTableCaption caption = do
id' <- gets stTableCaptionId
modify (\st -> st{ stTableCaptionId = id' + 1 })
capterm <- translateTerm Term.Table
- return $ numberedCaption "Table" capterm "Table" id' caption
+ return $ numberedCaption "TableCaption" capterm "Table" id' caption
numberedFigureCaption :: PandocMonad m => Doc Text -> OD m (Doc Text)
numberedFigureCaption caption = do