summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-01-18 23:36:54 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-01-18 23:36:54 +0100
commit4353deb0dee8095d17f47ad1130e069285fdd6f9 (patch)
treee122eb7587e836868b7c968e1bc3c3eca7c695f1
parentc3d67b3556c8184cdaf2e8ac999acc702e9d2c5f (diff)
parent35e90ced2448a9451ad2a753166398bf5177a96c (diff)
downloadorg-mode-4353deb0dee8095d17f47ad1130e069285fdd6f9.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/ox-latex.el33
1 files changed, 22 insertions, 11 deletions
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 6f6c5fa..70314a4 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -100,9 +100,11 @@
(if a (org-latex-export-to-pdf t s v b)
(org-open-file (org-latex-export-to-pdf nil s v b)))))))
:filters-alist '((:filter-options . org-latex-math-block-options-filter)
+ (:filter-paragraph . org-latex-clean-invalid-line-breaks)
(:filter-parse-tree org-latex-math-block-tree-filter
org-latex-matrices-tree-filter
- org-latex-image-link-filter))
+ org-latex-image-link-filter)
+ (:filter-verse-block . org-latex-clean-invalid-line-breaks))
:options-alist
'((:latex-class "LATEX_CLASS" nil org-latex-default-class t)
(:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
@@ -1624,6 +1626,25 @@ INFO is a plist used as a communication channel."
(format org-latex-compiler-file-string compiler))))
+;;; Filters
+
+(defun org-latex-matrices-tree-filter (tree _backend info)
+ (org-latex--wrap-latex-matrices tree info))
+
+(defun org-latex-math-block-tree-filter (tree _backend info)
+ (org-latex--wrap-latex-math-block tree info))
+
+(defun org-latex-math-block-options-filter (info _backend)
+ (dolist (prop '(:author :date :title) info)
+ (plist-put info prop
+ (org-latex--wrap-latex-math-block (plist-get info prop) info))))
+
+(defun org-latex-clean-invalid-line-breaks (data _backend _info)
+ (replace-regexp-in-string
+ "\\(\\end{[A-Za-z0-9*]+}\\|^\\)[ \t]*\\\\\\\\[ \t]*$" "\\1"
+ data))
+
+
;;; Template
(defun org-latex-template (contents info)
@@ -2688,8 +2709,6 @@ channel."
(t "\\[\n%s\\]"))
contents))
-(defun org-latex-matrices-tree-filter (tree _backend info)
- (org-latex--wrap-latex-matrices tree info))
;;;; Pseudo Object: LaTeX Math Block
@@ -2747,14 +2766,6 @@ containing export options. Modify DATA by side-effect and return it."
;; Return updated DATA.
data))
-(defun org-latex-math-block-tree-filter (tree _backend info)
- (org-latex--wrap-latex-math-block tree info))
-
-(defun org-latex-math-block-options-filter (info _backend)
- (dolist (prop '(:author :date :title) info)
- (plist-put info prop
- (org-latex--wrap-latex-math-block (plist-get info prop) info))))
-
(defun org-latex-math-block (_math-block contents _info)
"Transcode a MATH-BLOCK object from Org to LaTeX.
CONTENTS is a string. INFO is a plist used as a communication