From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Bug: When exporting to PDF an Org file where multiple footnotes share the same definition, only the first footnote is clickable [8.3.4 (8.3.4-39-ge0acd8-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20160418/)] Date: Mon, 25 Apr 2016 12:53:29 +0200 Message-ID: <87r3durmc6.fsf@gmx.us> References: <1461444845.13483.6.camel@gmail.com> <87h9eqt74z.fsf@gmx.us> <87a8kivzcc.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aue9E-00048D-9J for emacs-orgmode@gnu.org; Mon, 25 Apr 2016 06:53:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aue9B-0001xr-0a for emacs-orgmode@gnu.org; Mon, 25 Apr 2016 06:53:48 -0400 Received: from plane.gmane.org ([80.91.229.3]:59183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aue9A-0001xj-Q9 for emacs-orgmode@gnu.org; Mon, 25 Apr 2016 06:53:44 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aue97-0007ed-0M for emacs-orgmode@gnu.org; Mon, 25 Apr 2016 12:53:41 +0200 Received: from ip-37-201-6-126.hsi13.unitymediagroup.de ([37.201.6.126]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Apr 2016 12:53:40 +0200 Received: from rasmus by ip-37-201-6-126.hsi13.unitymediagroup.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Apr 2016 12:53:40 +0200 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" To: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Rasmus writes: > >> Ultimately, I think a decent fix would be to add a prefix to >> org-latex--label for targets pointing to footnotes. They should be >> prefixed with "fn:". Then, it should be easy to hack together >> a filter. > > OOC, isn't `org-export-filter-footnote-reference-functions' enough as > a filter? Probably I’m lacking the adequate creativity. I’ll sketch the problem as I see it. Consider the filter FUN and the below file. The transcoded version of the second "[fn:1]", say S2, will be passed to our filter FUN, if FUN is added to org-export-filter-footnote-reference-functions. But S2 will only contain the estimated number of the footnote¹, e.g. "\footnotemark[1]{}". In particular, we haven’t got the potentially transcoded reference to the footnote definition. Without the reference, I don’t know how to add a hyperref link. We could capture the transcoded version of the link "[[f1]]" in FUN, if FUN is added to org-export-filter-link-functions (I think). But by then we’d only be served a generic reference, e.g. "\ref{org925ce52}". I don’t know how we’d then differentiate between a link to a footnote and to some other type of element, e.g. a source block. Hence, it becomes hard to guess when to use e.g. \footref{.} instead of \ref{.}. Rasmus * head :PROPERTIES: :CUSTOM_ID: h1 :END: Line1.[fn:1] or [[f1]] \pagebreak Line2[fn:1] [[f1]] * Footnotes [fn:1] <> Footnote. Footnotes: ¹ It’s estimated because it’s not done on the latex side. E.g. I can get an incorrect number by adding this to the top of my file: #+latex: \addtocounter{footnote}{1} More realistically, breakage would occur when a footnote is added by some arbitrary latex command that Org doesn’t know about. -- Dung makes an excellent fertilizer