Explorar o código

org-e-latex: Fix error in documents with empty footnote definitions

* contrib/lisp/org-e-latex.el (org-e-latex-footnote-reference):
  Provide a fallback definition when none is available.
Nicolas Goaziou %!s(int64=12) %!d(string=hai) anos
pai
achega
30ef385ee0
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      contrib/lisp/org-e-latex.el

+ 4 - 2
contrib/lisp/org-e-latex.el

@@ -1371,9 +1371,11 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 	   thereis (memq (org-element-type parent)
 			 '(footnote-reference footnote-definition table-cell)))
      "\\footnotemark")
-    ;; Otherwise, define it with \footnote command.
+    ;; Otherwise, define it with \footnote command.  If no definition
+    ;; is available, notify it with an intrusive fallback one.
     (t
-     (let ((def (org-export-get-footnote-definition footnote-reference info)))
+     (let ((def (or (org-export-get-footnote-definition footnote-reference info)
+		    '("FOOTNOTE DEFINITION NOT FOUND."))))
        (unless (eq (org-element-type def) 'org-data)
 	 (setq def (cons 'org-data (cons nil def))))
        (concat