Browse Source

ox-latex: Fix repeated footnotes in tables

* lisp/ox-latex.el (org-latex--delayed-footnotes-definitions): Fix
  referencing multiple occurrences of the same footnote in a table.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/108789>
Nicolas Goaziou 9 years ago
parent
commit
908b3b05cd
1 changed files with 6 additions and 7 deletions
  1. 6 7
      lisp/ox-latex.el

+ 6 - 7
lisp/ox-latex.el

@@ -1521,17 +1521,16 @@ Footnotes definitions are returned within \"\\footnotetext{}\"
 commands.
 commands.
 
 
 This function is used within constructs that don't support
 This function is used within constructs that don't support
-\"\\footnote{}\" command (i.e. an item's tag).  In that case,
+\"\\footnote{}\" command (e.g, an item tag).  In that case,
 \"\\footnotemark\" is used within the construct and the function
 \"\\footnotemark\" is used within the construct and the function
 just outside of it."
 just outside of it."
   (mapconcat
   (mapconcat
    (lambda (ref)
    (lambda (ref)
-     (format
-      "\\footnotetext[%s]{%s}"
-      (org-export-get-footnote-number ref info)
-      (org-trim
-       (org-export-data
-	(org-export-get-footnote-definition ref info) info))))
+     (let ((def (org-export-get-footnote-definition ref info)))
+       (format "\\footnotetext[%d]{%s%s}"
+	       (org-export-get-footnote-number ref info)
+	       (org-trim (org-latex--label def info t t))
+	       (org-trim (org-export-data def info)))))
    ;; Find every footnote reference in ELEMENT.
    ;; Find every footnote reference in ELEMENT.
    (letrec ((all-refs nil)
    (letrec ((all-refs nil)
 	    (search-refs
 	    (search-refs