From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas S. Dye Subject: Re: Footnote attributes Date: Mon, 18 Jan 2016 17:45:10 -1000 Message-ID: References: <87bn8lsjsg.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLNEe-00007w-L8 for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 22:45:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLNEb-0001hJ-FB for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 22:45:36 -0500 Received: from gproxy2-pub.mail.unifiedlayer.com ([69.89.18.3]:37475) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1aLNEb-0001c9-7k for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 22:45:33 -0500 In-reply-to: <87bn8lsjsg.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode Aloha Nicolas, Nicolas Goaziou writes: > Hello, > > Thomas S. Dye 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