From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leonard Randall Subject: Multiple footnote references in included file Date: Sun, 6 Sep 2015 01:30:17 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d2cf4b5bf34051f093c38 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYNqd-00057U-QP for emacs-orgmode@gnu.org; Sat, 05 Sep 2015 20:30:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYNqc-0001Kt-Ba for emacs-orgmode@gnu.org; Sat, 05 Sep 2015 20:30:19 -0400 Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:32777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYNqc-0001Ko-5D for emacs-orgmode@gnu.org; Sat, 05 Sep 2015 20:30:18 -0400 Received: by oixx17 with SMTP id x17so29181943oix.0 for ; Sat, 05 Sep 2015 17:30:17 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --001a113d2cf4b5bf34051f093c38 Content-Type: text/plain; charset=UTF-8 Hi org mode community, I have my thesis divided into several chapters each with its own org file. I was trying to use org's Include function to compile a pdf of the complete draft using a master file. However, I found that if there was more than one reference to the same footnote in one of my chapter files, the exporter would complain that a footnote was undefined. In my case this occurred because I keep old versions of chapter sections under an archive heading, and at least up til now I did not change the names of footnotes, when I copied material over from one draft to the next. It seemed strange that it would even register these older references, because I exclude these headlines from export, but it seems to do so. The problem also occurs if both references are in a headline that is supposed to be exported. I am using org version 8.3.1 from elpa, and I am running Emacs 25.0.50.1 compiled for Windows 64. The problem can be reproduced with the following minimal examples. Suppose this is the master file: ---- Begin Master.org --- * Here is my master file It has an include command. #+INCLUDE: "./Included.org" --- End Master.org --- If I try to export this file it will throw up an error with either one of the following include files. --- begin Included.org --- #+EXCLUDE_TAGS: noexp archive notes #+ARCHIVE: ::* Archived * This is a headline. This is some text. [fn:dd1cd1f9] * Archive :archive: ** This is a headline (draft 0) Here is a previous version of the text to which I affixed the same footnote. [fn:dd1cd1f9] * Footnotes [fn:dd1cd1f9] Here is the footnote --- end Included.org --- --- begin Included.org --- * This is a headline. This is some text. [fn:dd1cd1f9] Here is some more text to which I wish to affix the same footnote. [fn:dd1cd1f9] * Footnotes [fn:dd1cd1f9] Here is a footnote --- end Included.org --- I get the following backtrace: --- --- Debugger entered--Lisp error: (error "Definition not found for footnote fn:dd1cd1f9 in file c:/Users/leotr/G/P/Tests/Included.org") signal(error ("Definition not found for footnote fn:dd1cd1f9 in file c:/Users/leotr/G/P/Tests/Included.org")) error("Definition not found for footnote %s in file %s" "fn:dd1cd1f9" "c:/Users/leotr/G/P/Tests/Included.org") org-export--prepare-file-contents("c:/Users/leotr/G/P/Tests/Included.org" nil 0 2 1 #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...))) org-export-expand-include-keyword() org-export-as(latex nil nil nil (:output-file "./Main.tex")) org-export-to-file(latex "./Main.tex" nil nil nil nil nil) org-latex-export-to-latex(nil nil nil nil) org-export-dispatch(nil) funcall-interactively(org-export-dispatch nil) #(org-export-dispatch nil nil) ad-Advice-call-interactively(# org-export-dispatch nil nil) apply(ad-Advice-call-interactively # (org-export-dispatch nil nil)) call-interactively(org-export-dispatch nil nil) command-execute(org-export-dispatch) --- --- --001a113d2cf4b5bf34051f093c38 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi org mode community,

I have= my thesis divided into several chapters each with its own org file. I was = trying to use org's Include function to compile a pdf of the complete d= raft using a master file. However, I found that if there was more than one = reference to the same footnote in one of my chapter files, the exporter wou= ld complain that a footnote was undefined.

In my case this occurred= because I keep old versions of chapter sections under an archive heading, = and at least up til now I did not change the names of footnotes, when I cop= ied material over from one draft to the next. It seemed=C2=A0 strange that = it would even register these older references, because I exclude these head= lines from export, but it seems to do so. The problem also occurs if both r= eferences are in a headline that is supposed to be exported.

I am using org version 8.3.1 from elpa, and I am running Em= acs 25.0.50.1 compiled for Windows 64. The problem can be reproduced with t= he following minimal examples.

Suppose this is the master= file:

---- Begin Master.org ---
* Here is = my master file
It has an include command.
#+INCLUDE: "./Included= .org"
--- End Master.org ---

If I try = to export this file it will throw up an error with either one of the follow= ing include files.
--- begin Included.org ---
#+EXCLUDE_TA= GS: noexp archive notes
#+ARCHIVE: ::* Archived
* This is a headline= .

This is some text. [fn:dd1cd1f9]
* Archive=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 :archive:
** This is a headline (draft 0)
Here is a previou= s version of the text to which I affixed the same
footnote. [fn:dd1cd1f9= ]
* Footnotes

[fn:dd1cd1f9] Here is the footnote

--- end Included.org ---

--- begin Included.org ---
=
* This is a headline.
This is some text. [fn:dd1cd1f9]
Here is some more text to which I wish to affix the same footnote.=C2=A0 [= fn:dd1cd1f9]
* Footnotes

[fn:dd1cd1f9] Here is a footnote

=
--- end Included.org ---

I get the following b= acktrace:
---=C2=A0 ---
Debugger entered--Lisp = error: (error "Definition not found for footnote fn:dd1cd1f9 in file c= :/Users/leotr/G/P/Tests/Included.org")
=C2=A0 signal(error ("D= efinition not found for footnote fn:dd1cd1f9 in file c:/Users/leotr/G/P/Tes= ts/Included.org"))
=C2=A0 error("Definition not found for foot= note %s in file %s" "fn:dd1cd1f9" "c:/Users/leotr/G/P/T= ests/Included.org")
=C2=A0 org-export--prepare-file-contents("= c:/Users/leotr/G/P/Tests/Included.org" nil 0 2 1 #s(hash-table size 65= test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)))
=C2=A0 or= g-export-expand-include-keyword()
=C2=A0 org-export-as(latex nil nil nil= (:output-file "./Main.tex"))
=C2=A0 org-export-to-file(latex = "./Main.tex" nil nil nil nil nil)
=C2=A0 org-latex-export-to-l= atex(nil nil nil nil)
=C2=A0 org-export-dispatch(nil)
=C2=A0 funcall-= interactively(org-export-dispatch nil)
=C2=A0 #<subr call-interactive= ly>(org-export-dispatch nil nil)
=C2=A0 ad-Advice-call-interactively(= #<subr call-interactively> org-export-dispatch nil nil)
=C2=A0 app= ly(ad-Advice-call-interactively #<subr call-interactively> (org-expor= t-dispatch nil nil))
=C2=A0 call-interactively(org-export-dispatch nil n= il)
=C2=A0 command-execute(org-export-dispatch)
---=C2=A0 = ---

--001a113d2cf4b5bf34051f093c38--