emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] oc-csl: Fix footnote status reporting for wrapped citations
@ 2021-11-02 16:51 András Simonyi
  2021-11-02 17:35 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: András Simonyi @ 2021-11-02 16:51 UTC (permalink / raw)
  To: emacs-orgmode list

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

Dear All,

the attached simple patch fixes a problem in oc-csl.el which led to
missing footnote number information for citations that were
automatically footnote-wrapped based on the used CSL style.

best wishes,
András

[-- Attachment #2: 0001-oc-csl-Fix-footnote-status-reporting-for-wrapped-cit.patch --]
[-- Type: text/x-patch, Size: 1119 bytes --]

From 1423e0f600d8e4e29f275faa9c9117db9b081b19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A1s=20Simonyi?= <andras.simonyi@gmail.com>
Date: Tue, 2 Nov 2021 16:44:37 +0100
Subject: [PATCH] oc-csl: Fix footnote status reporting for wrapped citations

* lisp/oc-csl.el (org-cite-csl--create-structure): Update footnote information
when citation is wrapped in a footnote.
---
 lisp/oc-csl.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el
index 42886dc44..f59b14a88 100644
--- a/lisp/oc-csl.el
+++ b/lisp/oc-csl.el
@@ -506,7 +506,9 @@ INFO is the export state, as a property list."
     ;; a footnote, but isn't yet.
     (when (and (not footnote) (org-cite-csl--note-style-p info))
       (org-cite-adjust-note citation info)
-      (org-cite-wrap-citation citation info))
+      (org-cite-wrap-citation citation info)
+      (setq footnote (org-element-lineage citation
+                                          '(footnote-definition footnote-reference))))
     ;; Return structure.
     (apply #'citeproc-citation-create
            `(:note-index
-- 
2.25.1


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

* Re: [PATCH] oc-csl: Fix footnote status reporting for wrapped citations
  2021-11-02 16:51 [PATCH] oc-csl: Fix footnote status reporting for wrapped citations András Simonyi
@ 2021-11-02 17:35 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2021-11-02 17:35 UTC (permalink / raw)
  To: András Simonyi; +Cc: emacs-orgmode list

Hello,

András Simonyi <andras.simonyi@gmail.com> writes:

> the attached simple patch fixes a problem in oc-csl.el which led to
> missing footnote number information for citations that were
> automatically footnote-wrapped based on the used CSL style.

Applied with a small change. Thank you.

> +      (setq footnote (org-element-lineage citation
> +                                          '(footnote-definition footnote-reference))))

I removed `footnote-definition', which cannot happen after a call to
`org-cite-wrap-citation'.

Regards,
-- 
Nicolas Goaziou


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

end of thread, other threads:[~2021-11-02 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-02 16:51 [PATCH] oc-csl: Fix footnote status reporting for wrapped citations András Simonyi
2021-11-02 17:35 ` Nicolas Goaziou

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