emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [bug, patch, ox] INCLUDE and footnotes


From: Nicolas Goaziou
Subject: Re: [O] [bug, patch, ox] INCLUDE and footnotes
Date: Tue, 09 Dec 2014 20:14:37 +0100

Hello,

Rasmus <address@hidden> writes:

> When using LINES in `org-export--prepare-file-contents' the footnotes
> section is not preserved causing export to fail.
>
> Minimal example
>
> $> cat t{1,2}.org
> # this is t1.org
> * intro
> foo[fn:1]
> * sec2
> bar
> * Footnotes
>
> [fn:1] baz
>
>
> # this is t2.org
> #+INCLUDE: "./t1.org::#intro"
>
> And export t2.org.
>
> The attached patch fixes this by explicitly saving the footnote section
>
> (Aside: org-footnote-section is used in hackish ways; should we make a
> function that returns to correct regexp for the footnotes section?).
>
> It works in a rather large document of mine and in the minimal test.
>
> Should I apply it, or is there a better way to fix this bug?

Thanks for the patch. However, it is incorrect.

First `org-footnote-section' could be nil, in which case there is no
headline to look after.

Also, there may be multiple footnote sections in the included document,
or even some footnote definitions inside and some outside the single
section...

Eventually, you are inserting a headline in the source document, which
could break its structure (e.g., if you're only inserting a table).

You should only extract the definitions associated to the references
within the included part of the document. However, you cannot insert
them right after the included text, as it could break the surrounding
environment, e.g.,

  - item

    #+INCLUDE: some-table.org

A possible solution would be to somehow postpone insertion of footnotes
at the very end of the source document, not at the location of the
keyword. However it would need some testing.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]