[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [patch] more robust footnotes
From: |
Nicolas Goaziou |
Subject: |
Re: [O] [patch] more robust footnotes |
Date: |
Tue, 24 May 2016 23:54:13 +0200 |
Rasmus <address@hidden> writes:
> (:latex-default-table-mode nil nil org-latex-default-table-mode)
> (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format)
> (:latex-footnote-separator nil nil org-latex-footnote-separator)
> + (:latex-footnote-defined-format nil nil
> org-latex-footnote-defined-format)
How dare you break the lexical order of the properties here? :)
> @@ -1246,6 +1257,8 @@ Eventually, if FULL is non-nil, wrap label within
> \"\\label{}\"."
> org-latex-math-environments-re
> (org-element-property :value datum))
> "eq:"))
> + (footnote-reference "fn:")
> + (footnote-definition "fn:")
You don't seem to use the latter. Does it still make sense to provide
it?
> + (format "\\footnote{%s%s}" (org-trim (org-export-data def info))
> + ;; Only insert a label if there exist another
> + ;; reference to def.
> + (if (org-element-map
> + (plist-get info :parse-tree)
> + 'footnote-reference
> + (lambda (f)
> + (and (not (eq f footnote-reference))
> + (eq def (org-export-get-footnote-definition f
> info))))
> + info t)
> + (org-trim (org-latex--label def info t t))
> + ""))
I suggest to avoid calling repeatedly
`org-export-get-footnote-definition'. Also, if the footnote reference is
anonymous, there is no point in calling `org-element-map'. The following
is more efficient:
(format "\\footnote{%s%s}"
(org-trim (org-export-data def info))
;; Only insert a label if there exist another reference to def.
(cond
((not label) "")
((org-element-map (plist-get info :parse-tree) 'footnote-reference
(lambda (f)
(and (not (eq f footnote-reference))
(equal (org-element-property :label f) label)
(org-latex--label def info t t)))
info t))
(t "")))
Thank you for you work.
Regards,
- Re: [O] 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/)], Rasmus, 2016/05/22
- Re: [O] 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/)], Nicolas Goaziou, 2016/05/23
- [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/)]), Rasmus, 2016/05/24
- Re: [O] [patch] more robust footnotes, Nicolas Goaziou, 2016/05/24
- Re: [O] [patch] more robust footnotes, Rasmus, 2016/05/24
- Re: [O] [patch] more robust footnotes,
Nicolas Goaziou <=
- Re: [O] [patch] more robust footnotes, Rasmus, 2016/05/25
- Re: [O] [patch] more robust footnotes, Nicolas Goaziou, 2016/05/25
- Re: [O] [patch] more robust footnotes, Rasmus, 2016/05/25