Aloha Nicolas,

Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Thomas S. Dye <t...@tsdye.com> 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

Reply via email to