forked from mirrors/org-mode
ox: Add post-blanks when latex is verbatim
* lisp/ox.el (org-export--remove-uninterpreted-data): Add post-blanks when latex is verbatim.
This commit is contained in:
parent
d73f65b57a
commit
9bde6350d1
41
lisp/ox.el
41
lisp/ox.el
|
@ -2919,20 +2919,22 @@ returned by the function."
|
|||
'(entity bold italic latex-environment latex-fragment strike-through
|
||||
subscript superscript underline)
|
||||
(lambda (datum)
|
||||
(let ((new
|
||||
(cl-case (org-element-type datum)
|
||||
(let* ((type (org-element-type datum))
|
||||
(post-blank
|
||||
(pcase (org-element-property :post-blank datum)
|
||||
(`nil nil)
|
||||
(n (make-string n (if (eq type 'latex-environment) ?\n ?\s)))))
|
||||
(new
|
||||
(cl-case type
|
||||
;; ... entities...
|
||||
(entity
|
||||
(and (not (plist-get info :with-entities))
|
||||
(list (concat
|
||||
(org-export-expand datum nil)
|
||||
(make-string
|
||||
(or (org-element-property :post-blank datum) 0)
|
||||
?\s)))))
|
||||
(list (concat (org-export-expand datum nil)
|
||||
post-blank))))
|
||||
;; ... emphasis...
|
||||
((bold italic strike-through underline)
|
||||
(and (not (plist-get info :with-emphasize))
|
||||
(let ((marker (cl-case (org-element-type datum)
|
||||
(let ((marker (cl-case type
|
||||
(bold "*")
|
||||
(italic "/")
|
||||
(strike-through "+")
|
||||
|
@ -2940,16 +2942,12 @@ returned by the function."
|
|||
(append
|
||||
(list marker)
|
||||
(org-element-contents datum)
|
||||
(list (concat
|
||||
marker
|
||||
(make-string
|
||||
(or (org-element-property :post-blank datum)
|
||||
0)
|
||||
?\s)))))))
|
||||
(list (concat marker post-blank))))))
|
||||
;; ... LaTeX environments and fragments...
|
||||
((latex-environment latex-fragment)
|
||||
(and (eq (plist-get info :with-latex) 'verbatim)
|
||||
(list (org-export-expand datum nil))))
|
||||
(list (concat (org-export-expand datum nil)
|
||||
post-blank))))
|
||||
;; ... sub/superscripts...
|
||||
((subscript superscript)
|
||||
(let ((sub/super-p (plist-get info :with-sub-superscript))
|
||||
|
@ -2957,18 +2955,11 @@ returned by the function."
|
|||
(and (or (not sub/super-p)
|
||||
(and (eq sub/super-p '{}) (not bracketp)))
|
||||
(append
|
||||
(list (concat
|
||||
(if (eq (org-element-type datum) 'subscript)
|
||||
"_"
|
||||
"^")
|
||||
(list (concat (if (eq type 'subscript) "_" "^")
|
||||
(and bracketp "{")))
|
||||
(org-element-contents datum)
|
||||
(list (concat
|
||||
(and bracketp "}")
|
||||
(and (org-element-property :post-blank datum)
|
||||
(make-string
|
||||
(org-element-property :post-blank datum)
|
||||
?\s)))))))))))
|
||||
(list (concat (and bracketp "}")
|
||||
post-blank)))))))))
|
||||
(when new
|
||||
;; Splice NEW at DATUM location in parse tree.
|
||||
(dolist (e new (org-element-extract-element datum))
|
||||
|
|
Loading…
Reference in a new issue