emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite)
@ 2021-09-18 20:22 Elias Bounatirou
  2021-09-18 20:38 ` Bruce D'Arcus
  0 siblings, 1 reply; 8+ messages in thread
From: Elias Bounatirou @ 2021-09-18 20:22 UTC (permalink / raw)
  To: org-mode-email

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

Hi,
When I try to insert a citation as the first item into a
non-inline-definition footnote, org-ref-cite refuses to insert the citation
returning in the minibuffer "Cannot insert citation here". The same problem
does not occur if the footnote has an inline definition. As for
non-inline-definition footnotes, if I copy the citation into the footnote,
no problem occurs, either. The citation is also properly exported to LaTeX.
Is this a problem of org-cite/org-mode in general or rather of org-ref-cite?

Best regards,
Elias

[-- Attachment #2: Type: text/html, Size: 643 bytes --]

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

* Re: Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite)
  2021-09-18 20:22 Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite) Elias Bounatirou
@ 2021-09-18 20:38 ` Bruce D'Arcus
  2021-10-05 21:39   ` Elias Bounatirou
  0 siblings, 1 reply; 8+ messages in thread
From: Bruce D'Arcus @ 2021-09-18 20:38 UTC (permalink / raw)
  To: Elias Bounatirou; +Cc: org-mode-email

Elias - do you mean org-cite-insert won't allow this?

[fn:1] [cite:@doe2019].

If yes, I don't see that; it inserts fine.

I'm using bibtex-actions for the insert processor, but I don't think
that should make any difference, since it's org-cite that's handling
that.

On Sat, Sep 18, 2021 at 4:23 PM Elias Bounatirou
<elias.bounatirou@gmail.com> wrote:
>
> Hi,
> When I try to insert a citation as the first item into a non-inline-definition footnote, org-ref-cite refuses to insert the citation returning in the minibuffer "Cannot insert citation here". The same problem does not occur if the footnote has an inline definition. As for non-inline-definition footnotes, if I copy the citation into the footnote, no problem occurs, either. The citation is also properly exported to LaTeX.
> Is this a problem of org-cite/org-mode in general or rather of org-ref-cite?
>
> Best regards,
> Elias


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

* Re: Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite)
  2021-09-18 20:38 ` Bruce D'Arcus
@ 2021-10-05 21:39   ` Elias Bounatirou
  2021-10-05 21:51     ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Elias Bounatirou @ 2021-10-05 21:39 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: org-mode-email

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

I have looked at the problem that citations cannot be inserted as 1st items
in footnotes once again more closely. It has become obvious for me that
this is indeed a bug of org-cite or rather a default setting which was
deliberately introduced, although it is not really user-friendly or
practical to my mind.

I modified the function org-cite--allowed-p in oc.el  and inserted
'footnote-definition' in the following lines:

;; Paragraphs and blank lines at top of document are fine.
     ((memq type '(nil paragraph footnote-definition)))

(I leave the comment in its original form to make the passage easier to
identify.) 'footnote-definition' by the way does not appear anywhere in
org-cite--allowed-p in its current form.
After this I can easily insert footnotes as 1st items in citations, and I
do not get Org's warning "Cannot insert citation here".

Am Sa., 18. Sept. 2021 um 22:39 Uhr schrieb Bruce D'Arcus <bdarcus@gmail.com
>:

> Elias - do you mean org-cite-insert won't allow this?
>
> [fn:1] [cite:@doe2019].
>
> If yes, I don't see that; it inserts fine.
>
> I'm using bibtex-actions for the insert processor, but I don't think
> that should make any difference, since it's org-cite that's handling
> that.
>
> On Sat, Sep 18, 2021 at 4:23 PM Elias Bounatirou
> <elias.bounatirou@gmail.com> wrote:
> >
> > Hi,
> > When I try to insert a citation as the first item into a
> non-inline-definition footnote, org-ref-cite refuses to insert the citation
> returning in the minibuffer "Cannot insert citation here". The same problem
> does not occur if the footnote has an inline definition. As for
> non-inline-definition footnotes, if I copy the citation into the footnote,
> no problem occurs, either. The citation is also properly exported to LaTeX.
> > Is this a problem of org-cite/org-mode in general or rather of
> org-ref-cite?
> >
> > Best regards,
> > Elias
>

[-- Attachment #2: Type: text/html, Size: 2485 bytes --]

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

* Re: Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite)
  2021-10-05 21:39   ` Elias Bounatirou
@ 2021-10-05 21:51     ` Nicolas Goaziou
  2021-10-06 12:44       ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2021-10-05 21:51 UTC (permalink / raw)
  To: Elias Bounatirou; +Cc: org-mode-email, Bruce D'Arcus

Hello,

Elias Bounatirou <elias.bounatirou@gmail.com> writes:

> I have looked at the problem that citations cannot be inserted as 1st items
> in footnotes once again more closely. It has become obvious for me that
> this is indeed a bug of org-cite or rather a default setting which was
> deliberately introduced, although it is not really user-friendly or
> practical to my mind.

This is not intentional.

> I modified the function org-cite--allowed-p in oc.el  and inserted
> 'footnote-definition' in the following lines:
>
> ;; Paragraphs and blank lines at top of document are fine.
>      ((memq type '(nil paragraph footnote-definition)))

This allows one to insert a citation in the middle of the citation
number, which is not desirable either. IOW, an additional check is
required.

Regards,
-- 
Nicolas Goaziou


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

* Re: Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite)
  2021-10-05 21:51     ` Nicolas Goaziou
@ 2021-10-06 12:44       ` Nicolas Goaziou
  2021-10-08 13:39         ` Elias Bounatirou
  2021-10-09 20:12         ` test-org-cite/list-citations failure (was: Citation not inserted as 1st item in footnote ...) Kyle Meyer
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2021-10-06 12:44 UTC (permalink / raw)
  To: Elias Bounatirou; +Cc: Bruce D'Arcus, org-mode-email

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> This allows one to insert a citation in the middle of the citation
> number, which is not desirable either. IOW, an additional check is
> required.

I think this is now fixed. Thank you.

Regards,
-- 
Nicolas Goaziou


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

* Re: Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite)
  2021-10-06 12:44       ` Nicolas Goaziou
@ 2021-10-08 13:39         ` Elias Bounatirou
  2021-10-09 20:12         ` test-org-cite/list-citations failure (was: Citation not inserted as 1st item in footnote ...) Kyle Meyer
  1 sibling, 0 replies; 8+ messages in thread
From: Elias Bounatirou @ 2021-10-08 13:39 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Bruce D'Arcus, org-mode-email

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

Great, thanks! I can confirm it works now. Once again thank you very much.
Best regards,
Elias

Am Mi., 6. Okt. 2021 um 14:44 Uhr schrieb Nicolas Goaziou <
mail@nicolasgoaziou.fr>:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
> > This allows one to insert a citation in the middle of the citation
> > number, which is not desirable either. IOW, an additional check is
> > required.
>
> I think this is now fixed. Thank you.
>
> Regards,
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 898 bytes --]

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

* test-org-cite/list-citations failure (was: Citation not inserted as 1st item in footnote ...)
  2021-10-06 12:44       ` Nicolas Goaziou
  2021-10-08 13:39         ` Elias Bounatirou
@ 2021-10-09 20:12         ` Kyle Meyer
  2021-10-09 21:03           ` test-org-cite/list-citations failure Nicolas Goaziou
  1 sibling, 1 reply; 8+ messages in thread
From: Kyle Meyer @ 2021-10-09 20:12 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode-email, Bruce D'Arcus, Elias Bounatirou

Hi Nicolas,

Nicolas Goaziou writes:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
>> This allows one to insert a citation in the middle of the citation
>> number, which is not desirable either. IOW, an additional check is
>> required.
>
> I think this is now fixed. Thank you.

It looks like this commit introduced a test failure.  Starting with
7d22dca54 (oc: Fix citations in footnotes when using biblatex back-end,
2021-10-06), test-org-cite/list-citations fails on my end (Emacs 27.2):

--8<---------------cut here---------------start------------->8---
Test test-org-cite/list-citations condition:
    (ert-test-failed
     ((should
       (equal '...
	(org-test-with-parsed-data "Text[fn:1]
[fn:1] [fn:2][cite:@a]

[fn:2] [cite:@b]" ...)))
      :form
      (equal
       ("b" "a")
       ("a"))
      :value nil :explanation
      (proper-lists-of-different-length 2 1
					("b" "a")
					("a")
					first-mismatch-at 0)))
   FAILED  1/1  test-org-cite/list-citations (0.015186 sec)
--8<---------------cut here---------------end--------------->8---


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

* Re: test-org-cite/list-citations failure
  2021-10-09 20:12         ` test-org-cite/list-citations failure (was: Citation not inserted as 1st item in footnote ...) Kyle Meyer
@ 2021-10-09 21:03           ` Nicolas Goaziou
  0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2021-10-09 21:03 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Bruce D'Arcus, org-mode-email, Elias Bounatirou

Hello,

Kyle Meyer <kyle@kyleam.com> writes:

> It looks like this commit introduced a test failure.

Fixed. Thank you.

Regards,
-- 
Nicolas Goaziou


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

end of thread, other threads:[~2021-10-09 21:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-18 20:22 Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite) Elias Bounatirou
2021-09-18 20:38 ` Bruce D'Arcus
2021-10-05 21:39   ` Elias Bounatirou
2021-10-05 21:51     ` Nicolas Goaziou
2021-10-06 12:44       ` Nicolas Goaziou
2021-10-08 13:39         ` Elias Bounatirou
2021-10-09 20:12         ` test-org-cite/list-citations failure (was: Citation not inserted as 1st item in footnote ...) Kyle Meyer
2021-10-09 21:03           ` test-org-cite/list-citations failure 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).