summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Extensions.hs1
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs8
2 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs
index adc8b4646..22e7cc845 100644
--- a/src/Text/Pandoc/Extensions.hs
+++ b/src/Text/Pandoc/Extensions.hs
@@ -612,6 +612,7 @@ getAllExtensions f = universalExtensions <> getAll f
, Ext_raw_tex
, Ext_task_lists
, Ext_literate_haskell
+ , Ext_empty_paragraphs
]
getAll "beamer" = getAll "latex"
getAll "context" = autoIdExtensions <>
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 4426c8da1..9eb7be4f6 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -404,7 +404,13 @@ blockToLaTeX (Para [Str ".",Space,Str ".",Space,Str "."]) = do
then blockToLaTeX (RawBlock "latex" "\\pause")
else inlineListToLaTeX [Str ".",Space,Str ".",Space,Str "."]
blockToLaTeX (Para lst) =
- inlineListToLaTeX lst
+ if null lst
+ then do
+ opts <- gets stOptions
+ if isEnabled Ext_empty_paragraphs opts
+ then pure "\\hfill\\par"
+ else pure mempty
+ else inlineListToLaTeX lst
blockToLaTeX (LineBlock lns) =
blockToLaTeX $ linesToPara lns
blockToLaTeX (BlockQuote lst) = do