Make LaTeX writer sensitive to empty_paragraphs extension.

Closes #9443.
This commit is contained in:
John MacFarlane committed 2024-02-13 15:50:12 -08:00
1 parent d836da7435
commit 2d83b7ca6f
3 files changed
+9 -2

No files matched your search

+1 -1
View File
@@ -3549,7 +3549,7 @@ input formats
: `docx`, `html`
output formats
: `docx`, `odt`, `opendocument`, `html`
: `docx`, `odt`, `opendocument`, `html`, `latex`
#### Extension: `native_numbering` ####
+1
View File
@@ -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 <>
+7 -1
View File
@@ -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