emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Footnotes in image captions
@ 2016-08-25 15:08 Arun Isaac
  2016-08-26 14:37 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Arun Isaac @ 2016-08-25 15:08 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]


Footnotes in image captions are not picked up and published. Is this
intended behaviour? If it is intended behaviour, would it not be nice to
allow footnotes in image captions too?

I am using the html backend, and the following org code:

#+CAPTION: Foo [fn::bar]
[[./foo.png]]

Regards,
Arun Isaac

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Footnotes in image captions
  2016-08-25 15:08 Footnotes in image captions Arun Isaac
@ 2016-08-26 14:37 ` Nicolas Goaziou
  2016-08-26 18:23   ` Arun Isaac
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2016-08-26 14:37 UTC (permalink / raw)
  To: Arun Isaac; +Cc: emacs-orgmode@gnu.org

Hello,

Arun Isaac <arunisaac@systemreboot.net> writes:

> Footnotes in image captions are not picked up and published. Is this
> intended behaviour?

Yes, it is.

> If it is intended behaviour, would it not be nice to allow footnotes
> in image captions too?

I think it is a can of worms. For example, you cannot properly number
footnotes anymore since there's no guarantee a caption is going to be
exported.

Note that footnote references are explicitly excluded from keywords in
org-element.el.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Footnotes in image captions
  2016-08-26 14:37 ` Nicolas Goaziou
@ 2016-08-26 18:23   ` Arun Isaac
  2016-08-28 13:07     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Arun Isaac @ 2016-08-26 18:23 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]


> I think it is a can of worms. For example, you cannot properly number
> footnotes anymore since there's no guarantee a caption is going to be
> exported.

In my use case, I can guarantee that all captions will be exported. So,
could footnotes in captions be implemented as an optional feature that
the user can enable by setting some variable? Or will that be too much
trouble?

Regards,
Arun Isaac.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Footnotes in image captions
  2016-08-26 18:23   ` Arun Isaac
@ 2016-08-28 13:07     ` Nicolas Goaziou
  2016-08-28 15:42       ` Arun Isaac
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2016-08-28 13:07 UTC (permalink / raw)
  To: Arun Isaac; +Cc: emacs-orgmode@gnu.org

Hello,

Arun Isaac <arunisaac@systemreboot.net> writes:

> In my use case, I can guarantee that all captions will be exported. So,
> could footnotes in captions be implemented as an optional feature that
> the user can enable by setting some variable?

That's not an option, because this is forbidden at the syntax level,
i.e., "thou shall not use footnotes in keywords", and I don't want Org
_format_ to be customizable.

> Or will that be too much trouble?

The "keywords" location in the restriction above is rather large as it
contains both regular keywords (e.g., TITLE) and captions.

Adding footnotes in regular keywords is really too much trouble at this
point. During export, what keywords are parsed changes according to the
export back-end used. Besides some keywords can also be defined as
properties, which means you need to allow footnote references in node
properties.

Adding footnotes to captions only /may/ be painful too. Some back-ends
ignore captions, or ignore captions associated to a certain type of
element (e.g., a paragraph). In these cases, footnotes export is mostly
broken, because it cannot properly number them.

Another difficult situation I can think of is tables. If you use
a caption in both a table and its caption, the reference order depends
on some other variable, e.g., `org-html-table-caption-above', so, again,
the footnotes handling is going to be broken in a non-trivial way in
some cases.

There are also special cases, even when Org does not handle footnotes
itself. Under `latex' back-end, using "listings" package, caption is
defined as a parameter of the "\lstset" command, e.g.,

  \lstset{language=Lisp,label= ,caption={Foo}, ...}

I don't know if additional footnotes commands are supported in such
a parameter.

In a nutshell, I'm sure that it will work in your use case, and I can
even perceive the interest in having footnotes within captions. However,
handling all the implied corner cases is going to be some tedious work,
if doable at all. We might try, nonetheless, to introduce footnotes in
captions as an experimental feature, but not before 9.0 release, and not
without some developer support to handle the issues that would arise (as
a reminder I'm an expert neither in LaTeX nor in HTML).

WDYT?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Footnotes in image captions
  2016-08-28 13:07     ` Nicolas Goaziou
@ 2016-08-28 15:42       ` Arun Isaac
  0 siblings, 0 replies; 5+ messages in thread
From: Arun Isaac @ 2016-08-28 15:42 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]


> In a nutshell, I'm sure that it will work in your use case, and I can
> even perceive the interest in having footnotes within captions. However,
> handling all the implied corner cases is going to be some tedious work,
> if doable at all. We might try, nonetheless, to introduce footnotes in
> captions as an experimental feature, but not before 9.0 release, and not
> without some developer support to handle the issues that would arise (as
> a reminder I'm an expert neither in LaTeX nor in HTML).
>
> WDYT?

I totally agree. No objections. When I brought up this matter, I thought
it might be just a little tweak to the org export code. I didn't realize
that there would be this many complications.

As for my use case, I can handle it easily enough without using
footnotes. So, I don't really need footnote support in image captions. I
only brought it up because I thought it might be a more generally useful
feature than my specific use case. So, this feature, if implemented, can
definitely wait. No hurry.

Regards,
Arun Isaac.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-28 15:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25 15:08 Footnotes in image captions Arun Isaac
2016-08-26 14:37 ` Nicolas Goaziou
2016-08-26 18:23   ` Arun Isaac
2016-08-28 13:07     ` Nicolas Goaziou
2016-08-28 15:42       ` Arun Isaac

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).