From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Footnote attributes Date: Sat, 16 Jan 2016 15:03:59 +0100 Message-ID: <87bn8lsjsg.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKRQc-0001JR-2D for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 09:02:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKRQY-0002Cf-Rt for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 09:02:06 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:53275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKRQY-0002CW-M2 for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 09:02:02 -0500 In-Reply-To: (Thomas S. Dye's message of "Fri, 15 Jan 2016 04:52:40 -1000") 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: "Thomas S. Dye" Cc: emacs-orgmode 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. Regards, -- Nicolas Goaziou