warning: CRLF will be replaced by LF in lisp/org-footnote.el. The file will have its original line endings in your working directory. diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index a0d6a56..9e1c407 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -769,6 +769,8 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': ref-table) ;; 5. Insert the footnotes again in the buffer, at the ;; appropriate spot. + + ;; cursor is positioned at the insertion point (goto-char ins-point) (cond ;; No footnote: exit. @@ -814,8 +816,17 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': ((not sort-only) (mapc (lambda (x) - (goto-char (nth 4 x)) - (org-footnote-goto-local-insertion-point) + + ;; cursor is moved again. Don't do it - ODT exporter is + ;; unhappy because definitions *follow* the reference. What + ;; needs to happen is that definition *must* precede the + ;; first reference. + + ;; DON' MOVE THE CURSOR + ;; (goto-char (nth 4 x)) + ;; (org-footnote-goto-local-insertion-point) + ;; DON'T MOVE THE CURSOR + (insert (format "\n[%s] %s\n" (nth 1 x) (nth 2 x)))) ref-table)) ;; Else, insert each definition at the end of the section