org-latex-paragraph: Ensure that paragraphs are not split by empty lines

* lisp/ox-latex.el (org-latex-paragraph): If export creates single
paragraph contents with empty lines, remove the empty lines to ensure
that we retain a single paragraph.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/tufdb6$11h2$1@ciao.gmane.io
This commit is contained in:
Ihor Radchenko 2023-03-11 11:34:45 +01:00
parent 5f817f21fc
commit 3d04af3826
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 8 additions and 1 deletions

View File

@ -2980,7 +2980,14 @@ information."
"Transcode a PARAGRAPH element from Org to LaTeX.
CONTENTS is the contents of the paragraph, as a string. INFO is
the plist used as a communication channel."
contents)
;; Ensure that we do not create multiple paragraphs, when a single
;; paragraph is expected.
;; Multiple newlines may appear in CONTENTS, for example, when
;; certain objects are stripped from export, leaving single newlines
;; before and after.
(replace-regexp-in-string
(rx "\n" (1+ (0+ space) "\n")) "\n"
contents))
;;;; Plain List