From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi 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: Wed, 10 Aug 2016 21:09:54 +0000 Message-ID: References: <1461444845.13483.6.camel@gmail.com> <87h9eqt74z.fsf@gmx.us> <87a8kivzcc.fsf@saiph.selenimh> <87r3durmc6.fsf@gmx.us> <87h9ep6hkx.fsf@saiph.selenimh> <874mapstdk.fsf@gmx.us> <87a8kh4wpp.fsf@saiph.selenimh> <87r3ctalx7.fsf@gmx.us> <87bn3w8nba.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c12f1d6bc45320539be12dd Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXalK-0003CG-PH for emacs-orgmode@gnu.org; Wed, 10 Aug 2016 17:10:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXalJ-0003Fy-1d for emacs-orgmode@gnu.org; Wed, 10 Aug 2016 17:10:06 -0400 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:35214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXalI-0003Fn-Rq for emacs-orgmode@gnu.org; Wed, 10 Aug 2016 17:10:04 -0400 Received: by mail-oi0-x234.google.com with SMTP id 4so76523365oih.2 for ; Wed, 10 Aug 2016 14:10:04 -0700 (PDT) In-Reply-To: <87bn3w8nba.fsf@saiph.selenimh> 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: Rasmus , emacs-orgmode@gnu.org, Nicolas Goaziou --94eb2c12f1d6bc45320539be12dd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi guys, Looks like I just reported the exact same bug few minutes back. @Rasmus: Are you still working on committing the fix for this? Thanks. Kaushal On Mon, May 23, 2016 at 5:42 PM Nicolas Goaziou wrote: > Hello, > > Rasmus writes: > > > With the attached patch ox-latex seems to behave in this way. > > Thank you. Some comments follow. > > > Though perhaps there=E2=80=99s a more efficient way to get the first > > footnote-reference to a given definition than trawling through with > > org-export--footnote-reference-map. > > Couldn't you refer to the definition instead of the first reference ? > There is a function grabbing it and it is unique for a given label. > Also, not that `org-export-get-footnote-definition' doesn't return the > definition itself, only its contents. Therefore the reference are > different and there is no possible ambiguity. > > > Nicolas, where is the info plist documented or defined/populated? > > It is documented at > . However, caches > used for memoization are not referenced. > > > + ;; Use \footnotemark if the footnote has already been defined. > > The comment no longer seems accurate. > > > + ((not (org-export-footnote-first-reference-p footnote-reference > info)) > > + (format "\\textsuperscript{\\ref{%s}}" > > + (org-latex--label > > + (catch 'exit > > + (org-export--footnote-reference-map > > + (lambda (f) > > + (let ((l (org-element-property :label f))) > > + (when (and l label (string=3D label l)) > > + (throw 'exit f)))) > > + (plist-get info :parse-tree) info)) > > + info t))) > > See above. > > > + ;; Use \footnotemark if reference is within another footnote > > + ;; reference, footnote definition or table cell. > > + ((org-element-lineage footnote-reference > > + '(footnote-reference footnote-definition > table-cell)) > > + "\\footnotemark") > > + ;; Otherwise, define it with \footnote command. > > + (t > > + (let ((def (org-export-get-footnote-definition > footnote-reference info))) > > + (concat > > + (format "\\footnote{%s%s}" (org-trim (org-export-data def info)= ) > > + (if (catch 'exit > > + (org-export--footnote-reference-map > > + (lambda (f) > > + (let ((l (org-element-property :label f))) > > + (when (and l label > > + (not (eq f footnote-reference)) > > + (string=3D label l)) > > + (throw 'exit t)))) > > + (plist-get info :parse-tree) info)) > > + (org-latex--label footnote-reference info t t) > > + "")) > > I'm not sure to understand the logic here. You seem to add a label to > all references sharing a given label but the first one. Intuitively, > I think it should be the opposite. > > Besides, in this branch of the `cond', all footnote references are the > first for their their label. > > Wouldn't it be sufficient to use > > (format "\\footnote{%s%s}" > (org-trim (org-export-data def info)) > (org-latex--label def info t t)) > > ? > > Regards, > > -- > Nicolas Goaziou > > -- Kaushal Modi --94eb2c12f1d6bc45320539be12dd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi guys,

Looks like I just reported the= exact same bug few minutes back.

@Rasmus: Are you= still working on committing the fix for this?

Tha= nks.

Kaushal

On Mon, May 23, 2016 at 5:42 PM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
Hello,

Rasmus <rasmus@gmx.us= > writes:

> With the attached patch ox-latex seems to behave in this way.

Thank you. Some comments follow.

> Though perhaps there=E2=80=99s a more efficient way to get the first > footnote-reference to a given definition than trawling through with > org-export--footnote-reference-map.

Couldn't you refer to the definition instead of the first reference ? There is a function grabbing it and it is unique for a given label.
Also, not that `org-export-get-footnote-definition' doesn't return = the
definition itself, only its contents. Therefore the reference are
different and there is no possible ambiguity.

> Nicolas, where is the info plist documented or defined/populated?

It is documented at
<http://orgmode.org/worg/dev/org-export-re= ference.html>. However, caches
used for memoization are not referenced.

> +=C2=A0 =C2=A0 =C2=A0 ;; Use \footnotemark if the footnote has already= been defined.

The comment no longer seems accurate.

> +=C2=A0 =C2=A0 =C2=A0 ((not (org-export-footnote-first-reference-p foo= tnote-reference info))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(format "\\textsuperscript{\\ref{%s}}= "
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-latex--label
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(catch 'exit
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-export--f= ootnote-reference-map
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (f) > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let (= (l (org-element-property :label f)))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (when (and l label (string=3D label l))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (throw 'exit f))))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (plist-get in= fo :parse-tree) info))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0info t)))

See above.

> +=C2=A0 =C2=A0 =C2=A0 ;; Use \footnotemark if reference is within anot= her footnote
> +=C2=A0 =C2=A0 =C2=A0 ;; reference, footnote definition or table cell.=
> +=C2=A0 =C2=A0 =C2=A0 ((org-element-lineage footnote-reference
> +=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'(footnote-reference footnote-definition table-cel= l))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0"\\footnotemark")
> +=C2=A0 =C2=A0 =C2=A0 ;; Otherwise, define it with \footnote command.<= br> > +=C2=A0 =C2=A0 =C2=A0 (t
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((def (org-export-get-footnote-defini= tion footnote-reference info)))
> +=C2=A0 =C2=A0 =C2=A0 (concat
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(format "\\footnote{%s%s}" (org-= trim (org-export-data def info))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (catch = 9;exit
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(org-export--footnote-reference-map
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (lambda (f)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 (let ((l (org-element-property :label f)))
> +=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 (when (and l label
> +=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(not (eq f f= ootnote-reference))
> +=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(string=3D l= abel l))
> +=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 (throw 'exit t))))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (plist-get info :parse-tree) info))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (org-latex--label footnote-reference info t t)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"&= quot;))

I'm not sure to understand the logic here. You seem to add a label to all references sharing a given label but the first one. Intuitively,
I think it should be the opposite.

Besides, in this branch of the `cond', all footnote references are the<= br> first for their their label.

Wouldn't it be sufficient to use

=C2=A0 (format "\\footnote{%s%s}"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-trim (org-export-data def info)) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-latex--label def info t t))

?

Regards,

--
Nicolas Goaziou

--

Kaushal Modi

--94eb2c12f1d6bc45320539be12dd--