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:
Nicolas Goaziou 2011-12-23 16:08:45 +01:00
parent 27480a2ee7
commit d7ba7d2e69
1 changed files with 18 additions and 21 deletions

View File

@ -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)) (cond
(label (org-element-get-property :label footnote-reference)) ((not (org-export-footnote-first-reference-p footnote-reference info))
;; Anonymous footnotes are always new footnotes. (format "\\footnotemark[%s]"
(seenp (and label (member label all-seen))) (org-export-get-footnote-number footnote-reference info)))
(inline-def-p (org-element-get-property ;; Inline definitions are secondary strings.
:inline-definition footnote-reference))) ((eq (org-element-get-property :type footnote-reference) 'inline)
(cond (format "\\footnote{%s}"
(seenp (format "\\footnotemark[%s]" (length seenp))) (org-trim
;; Inline definitions are secondary strings. (org-export-secondary-string
(inline-def-p (org-export-get-footnote-definition footnote-reference info)
(format "\\footnote{%s}" 'e-latex info))))
(org-trim ;; Non-inline footnotes definitions are full Org data.
(org-export-secondary-string inline-def-p 'latex info)))) (t
;; Non-inline footnotes necessarily contain a label. Retrieve (format "\\footnote{%s}"
;; match definition in `:footnotes-labels-alist'. (org-trim
(t (org-export-data
(format "\\footnote{%s}" (org-export-get-footnote-definition footnote-reference info)
(org-trim 'e-latex info)))))))
(org-export-data
(cdr (assoc label (plist-get info :footnotes-labels-alist)))
'latex info))))))))
;;;; Headline ;;;; Headline