[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Footnote attributes
From: |
Thomas S . Dye |
Subject: |
Re: [O] Footnote attributes |
Date: |
Mon, 18 Jan 2016 17:45:10 -1000 |
User-agent: |
mu4e 0.9.15-784d8c8; emacs 24.5.1 |
Aloha Nicolas,
Nicolas Goaziou <address@hidden> writes:
> Hello,
>
> Thomas S. Dye <address@hidden> writes:
>
>> I'm trying to hijack Org footnotes to export \sidenotes with an
>> optional offset parameter to LaTeX. I can't figure out how to specify
>> and access the offset parameter for a footnote.
>>
>> I have an attr_latex line in front of the footnote-definition and
>> footnote-reference, but I can't figure out how to retrieve it. Is this
>> possible? If so, how?
>>
>> I have this, but offset is always the empty string:
>>
>> (let* ((def (org-export-get-footnote-definition footnote-reference info))
>> (attr (org-export-read-attribute :attr_latex
>> footnote-reference))
>> (offs (plist-get attr :offset))
>> (offset (if offs (format "[%s]" offs) "")))
>
> `org-export-get-footnote-definition' doesn't return a full footnote
> definition objects, but only contents. Attributes are lost.
>
> You need to retrieve the definition within the parse tree, using
> `org-element-map', then extract the information you need. See for
> example `org-export-get-footnote-definition'.
>
> Note that there is no guarantee that there is a matching definition in
> the parse tree: the reference could as well be inline, or referencing an
> inline footnote reference.
Thanks. That worked easily.
All the best,
Tom
--
Thomas S. Dye
http://www.tsdye.com