From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Footnote attributes
Date: Sat, 16 Jan 2016 15:03:59 +0100 [thread overview]
Message-ID: <87bn8lsjsg.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <m2r3hiao93.fsf@tsdye.com> (Thomas S. Dye's message of "Fri, 15 Jan 2016 04:52:40 -1000")
Hello,
Thomas S. Dye <tsd@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.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2016-01-16 14:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 14:52 Footnote attributes Thomas S. Dye
2016-01-16 14:03 ` Nicolas Goaziou [this message]
2016-01-19 3:45 ` Thomas S. Dye
-- strict thread matches above, loose matches on Subject: below --
2016-01-14 1:20 Thomas S. Dye
2016-01-14 8:42 ` Nicolas Goaziou
2016-01-14 17:09 ` Thomas S. Dye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bn8lsjsg.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=tsd@tsdye.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).