* Re: empty footnotes in ODT export
2012-02-02 10:55 empty footnotes in ODT export Eric Abrahamsen
@ 2012-02-02 18:44 ` Jambunathan K
2012-02-02 19:44 ` Nicolas Goaziou
0 siblings, 1 reply; 5+ messages in thread
From: Jambunathan K @ 2012-02-02 18:44 UTC (permalink / raw)
To: Eric Abrahamsen; +Cc: Nicolas Goaziou, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> I've started using the ODT exporter, which is great except that files
> with footnotes export empty footnotes: the in-text links and footnote
> sections at the bottom of the pages are in place, but the text of the
> footnote itself is empty.
>
> I can't think of anything special about my org file setup, including how
> I use footnotes, or how I export. I have no `org-footnote-section' set,
> so the footnotes collect at the bottom of each section. I thought it
> might be because the file I'm working on now has a lot of Chinese in the
> footnotes, but this happens with all my files. I'm just using the 'o'
> key from the export dispatcher.
>
> Umm… I can't think of anything else. Can I provide any more info? Anyone
> else seeing this?
Eric
Next time, please provide an example org file and possible settings for
reproducing the bug.
Nicolas
Fix is in your court. Here is my analysis.
Read on ....
Disable footnote section.
#+begin_src emacs-lisp
(setq org-footnote-section nil)
#+end_src
Install this advice.
(defadvice org-export-preprocess-string
(after my-org-export-preprocess-string activate)
"Org buffer as seen by ODT exporter."
(message "---- BEGIN ---")
(message "%s" ad-return-value)
(message "---- END ---")
ad-return-value)
Export the attached footnote.org. Note that at the end of pre-process
footnote definition appear *before* the first footnote reference.
,---- POST-PREPROCESS
| ---- BEGIN ---
|
|
|
|
| * Headline1
| See footnote-1[1]
|
| [1] Footnote defintion-1.
|
| * Headline 2
| See footnote-2[2]
|
| [2] Footnote definition-2.
| [2 times]
| ---- END ---
`----
Apply the attached path to org-footnote.el. Refer my notes in the patch.
(OK, not really a patch. But a hint.)
,---- POST-PREPROCESS
| ---- BEGIN ---
|
| [1] Footnote defintion-1.
|
| [2] Footnote definition-2.
|
|
|
|
| * Headline1
| See footnote-1[1]
|
| * Headline 2
| See footnote-2[2]
| [2 times]
| ---- END ---
`----
Things are fine now.
> Thanks!
> Eric
--
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: footnote.org --]
[-- Type: text/x-org, Size: 541 bytes --]
#+TITLE: footnote.org
#+AUTHOR: Jambunathan K
#+EMAIL: kjambunathan@gmail.com
#+DATE: 2012-02-02 Thu
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE: en
#+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS: TeX:t LaTeX:dvipng skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:
#+LINK_HOME:
#+XSLT:
* Headline1
See footnote-1[fn:1]
[fn:1] Footnote defintion-1.
* Headline 2
See footnote-2[fn:2]
[fn:2] Footnote definition-2.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: org-footnote.el.diff --]
[-- Type: text/x-patch, Size: 1299 bytes --]
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
^ permalink raw reply related [flat|nested] 5+ messages in thread