[Top][All Lists]

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

[O] [patch] more robust footnotes (was: Bug: When exporting to PDF an Or

From: Rasmus
Subject: [O] [patch] more robust footnotes (was: 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: Tue, 24 May 2016 22:59:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)


Thanks for comments.

Nicolas Goaziou <address@hidden> writes:

>> Though perhaps there’s 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.

Yeah that's much better.  Thanks!

>> +      (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= 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))

The GOAL is to make "pretty" latex and not clutter every footnote with
labels.  I think the logic is better now, but it uses the plain
org-export-map rather than org-export--footnote-reference-map.  I guess
that’s anyway more clean and org-export-get-footnote-definition should do
the necessary caching.


Governments should be afraid of their people

Attachment: 0001-ox-html-Find-preamble-spec-case-insensitively.patch
Description: Text Data

reply via email to

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