emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* empty footnotes in ODT export
@ 2012-02-02 10:55 Eric Abrahamsen
  2012-02-02 18:44 ` Jambunathan K
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Abrahamsen @ 2012-02-02 10:55 UTC (permalink / raw)
  To: emacs-orgmode

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?

Thanks!
Eric

-- 
GNU Emacs 24.0.92.1 (i686-pc-linux-gnu, GTK+ Version 2.24.9)
 of 2012-01-26 on pellet
Org-mode version 7.8.03 (release_7.8.03.293.g36cc)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* 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

* Re: empty footnotes in ODT export
  2012-02-02 18:44 ` Jambunathan K
@ 2012-02-02 19:44   ` Nicolas Goaziou
  2012-02-02 20:02     ` Achim Gratz
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2012-02-02 19:44 UTC (permalink / raw)
  To: Jambunathan K; +Cc: Eric Abrahamsen, emacs-orgmode

Hello,

Jambunathan K <kjambunathan@gmail.com> writes:

> Fix is in your court. Here is my analysis.

Indeed, I introduced that problem with the previous attempt to fix the
other bug.  I think it's good now.

Thanks for your analysis.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: empty footnotes in ODT export
  2012-02-02 19:44   ` Nicolas Goaziou
@ 2012-02-02 20:02     ` Achim Gratz
  2012-02-02 20:33       ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Achim Gratz @ 2012-02-02 20:02 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:
> Indeed, I introduced that problem with the previous attempt to fix the
> other bug.  I think it's good now.

I still get the insertion error in the orgmode buffer as per the example
I sent earlier.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: empty footnotes in ODT export
  2012-02-02 20:02     ` Achim Gratz
@ 2012-02-02 20:33       ` Nicolas Goaziou
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2012-02-02 20:33 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>> Indeed, I introduced that problem with the previous attempt to fix the
>> other bug.  I think it's good now.
>
> I still get the insertion error in the orgmode buffer as per the example
> I sent earlier.

This message was about another unrelated bug (empty footnotes in ODT
export).


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-02 20:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-02-02 20:02     ` Achim Gratz
2012-02-02 20:33       ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).