EXPERIMENTAL/org-e-latex: Use new footnote API
* EXPERIMENTAL/org-e-latex.el (org-e-latex-footnote-reference): Rewrite function to use new footnote API.
This commit is contained in:
parent
27480a2ee7
commit
d7ba7d2e69
|
@ -881,27 +881,24 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
||||||
org-e-latex-footnote-separator)
|
org-e-latex-footnote-separator)
|
||||||
;; Use \footnotemark if the footnote has already been defined.
|
;; Use \footnotemark if the footnote has already been defined.
|
||||||
;; Otherwise, define it with \footnote command.
|
;; Otherwise, define it with \footnote command.
|
||||||
(let* ((all-seen (plist-get info :seen-footnote-labels))
|
|
||||||
(label (org-element-get-property :label footnote-reference))
|
|
||||||
;; Anonymous footnotes are always new footnotes.
|
|
||||||
(seenp (and label (member label all-seen)))
|
|
||||||
(inline-def-p (org-element-get-property
|
|
||||||
:inline-definition footnote-reference)))
|
|
||||||
(cond
|
(cond
|
||||||
(seenp (format "\\footnotemark[%s]" (length seenp)))
|
((not (org-export-footnote-first-reference-p footnote-reference info))
|
||||||
|
(format "\\footnotemark[%s]"
|
||||||
|
(org-export-get-footnote-number footnote-reference info)))
|
||||||
;; Inline definitions are secondary strings.
|
;; Inline definitions are secondary strings.
|
||||||
(inline-def-p
|
((eq (org-element-get-property :type footnote-reference) 'inline)
|
||||||
(format "\\footnote{%s}"
|
(format "\\footnote{%s}"
|
||||||
(org-trim
|
(org-trim
|
||||||
(org-export-secondary-string inline-def-p 'latex info))))
|
(org-export-secondary-string
|
||||||
;; Non-inline footnotes necessarily contain a label. Retrieve
|
(org-export-get-footnote-definition footnote-reference info)
|
||||||
;; match definition in `:footnotes-labels-alist'.
|
'e-latex info))))
|
||||||
|
;; Non-inline footnotes definitions are full Org data.
|
||||||
(t
|
(t
|
||||||
(format "\\footnote{%s}"
|
(format "\\footnote{%s}"
|
||||||
(org-trim
|
(org-trim
|
||||||
(org-export-data
|
(org-export-data
|
||||||
(cdr (assoc label (plist-get info :footnotes-labels-alist)))
|
(org-export-get-footnote-definition footnote-reference info)
|
||||||
'latex info))))))))
|
'e-latex info)))))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Headline
|
;;;; Headline
|
||||||
|
|
Loading…
Reference in New Issue