all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [patch] more robust footnotes
Date: Tue, 24 May 2016 23:54:13 +0200	[thread overview]
Message-ID: <87d1ob86m2.fsf@saiph.selenimh> (raw)
In-Reply-To: <87eg8r6srw.fsf@gmx.us> (rasmus@gmx.us's message of "Tue, 24 May 2016 23:38:27 +0200")

Rasmus <rasmus@gmx.us> writes:

>      (:latex-default-table-mode nil nil org-latex-default-table-mode)
>      (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format)
>      (:latex-footnote-separator nil nil org-latex-footnote-separator)
> +    (:latex-footnote-defined-format nil nil org-latex-footnote-defined-format)

How dare you break the lexical order of the properties here? :)

> @@ -1246,6 +1257,8 @@ Eventually, if FULL is non-nil, wrap label within \"\\label{}\"."
>  				  org-latex-math-environments-re
>  				  (org-element-property :value datum))
>  				 "eq:"))
> +			   (footnote-reference "fn:")
> +			   (footnote-definition "fn:")

You don't seem to use the latter. Does it still make sense to provide
it?

> +	  (format "\\footnote{%s%s}" (org-trim (org-export-data def info))
> +		  ;; Only insert a label if there exist another
> +		  ;; reference to def.
> +		  (if (org-element-map
> +			  (plist-get info :parse-tree)
> +			  'footnote-reference
> +			(lambda (f)
> +			  (and (not (eq f footnote-reference))
> +			       (eq def (org-export-get-footnote-definition f info))))
> +			info t)
> +		      (org-trim (org-latex--label def info t t))
> +		    ""))

I suggest to avoid calling repeatedly
`org-export-get-footnote-definition'. Also, if the footnote reference is
anonymous, there is no point in calling `org-element-map'. The following
is more efficient:

  (format "\\footnote{%s%s}"
          (org-trim (org-export-data def info))
          ;; Only insert a label if there exist another reference to def.
          (cond
           ((not label) "")
           ((org-element-map (plist-get info :parse-tree) 'footnote-reference
              (lambda (f)
                (and (not (eq f footnote-reference))
                     (equal (org-element-property :label f) label)
                     (org-latex--label def info t t)))
              info t))
           (t "")))

Thank you for you work.

Regards,

  reply	other threads:[~2016-05-24 21:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-23 20:54 Bug: When exporting to PDF an Org file where multiple footnotes share the same definition, only the first footnote is clickable [8.3.4 (8.3.4-39-ge0acd8-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20160418/)] Jorge Peixoto de Morais Neto
2016-04-25  8:38 ` Rasmus
2016-04-25  8:58   ` Nicolas Goaziou
2016-04-25 10:53     ` Rasmus
2016-04-25 11:41       ` Nicolas Goaziou
2016-04-25 13:36         ` Rasmus
2016-04-25 13:57           ` Nicolas Goaziou
2016-04-25 14:04             ` Rasmus
2016-04-25 14:07               ` Rasmus
2016-05-22 20:16             ` Rasmus
2016-05-23 21:41               ` Nicolas Goaziou
2016-05-24 20:59                 ` [patch] more robust footnotes (was: Bug: When exporting to PDF an Org file where multiple footnotes share the same definition, only the first footnote is clickable [8.3.4 (8.3.4-39-ge0acd8-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20160418/)]) Rasmus
2016-05-24 21:31                   ` [patch] more robust footnotes Nicolas Goaziou
2016-05-24 21:38                     ` Rasmus
2016-05-24 21:54                       ` Nicolas Goaziou [this message]
2016-05-25  7:16                         ` Rasmus
2016-05-25 16:50                           ` Nicolas Goaziou
2016-05-25 17:51                             ` Rasmus
2016-08-10 21:09                 ` Bug: When exporting to PDF an Org file where multiple footnotes share the same definition, only the first footnote is clickable [8.3.4 (8.3.4-39-ge0acd8-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20160418/)] Kaushal Modi

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d1ob86m2.fsf@saiph.selenimh \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.