emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Suggestions for improved suffix parsing in oc-biblatex
@ 2021-09-08 13:37 Denis Maier
  2021-09-20 11:08 ` Denis Maier
  2021-09-26 11:12 ` Bastien
  0 siblings, 2 replies; 11+ messages in thread
From: Denis Maier @ 2021-09-08 13:37 UTC (permalink / raw)
  To: Org Mode List, Elias Bounatirou

Hi,

I think the suffix parsing in oc-biblatex could be improved. Consider 
this example:

====================================
#+cite_export: biblatex authoryear

[cite:@doe 4]

[cite:@doe 4, with some more text]
=====================================

This gives us
=====================================
\autocite[4]{doe}

\autocite[4, with some more text]{doe}
=====================================

The problem is  that biblatex will add a label if the suffix consists 
only of a number, a range of numbers, or a list of numbers. So 
\autocite[4]{doe} will result (Doe 2021, p. 4). However, \autocite[4, 
with some more text]{doe} results in (Doe 2021, 4, with some more text). 
In this special case you'd have to help biblatex:
\autocite[\pnfmt{4}, with some more text]{doe}
=> (Doe 2021, p. 4, with some more text)

FWIW, pandoc's citeproc already has some support for this. There you can 
use braces to specify a locator in a complex suffix. Like so:
[cite:@doe {4}, with some more text]

I don't know how complex that is, but that would be a great addition.

Denis


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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-09-08 13:37 Suggestions for improved suffix parsing in oc-biblatex Denis Maier
@ 2021-09-20 11:08 ` Denis Maier
  2021-09-26 11:12 ` Bastien
  1 sibling, 0 replies; 11+ messages in thread
From: Denis Maier @ 2021-09-20 11:08 UTC (permalink / raw)
  To: Org Mode List, Elias Bounatirou

Bump

Am 08.09.2021 um 15:37 schrieb Denis Maier:
> Hi,
> 
> I think the suffix parsing in oc-biblatex could be improved. Consider 
> this example:
> 
> ====================================
> #+cite_export: biblatex authoryear
> 
> [cite:@doe 4]
> 
> [cite:@doe 4, with some more text]
> =====================================
> 
> This gives us
> =====================================
> \autocite[4]{doe}
> 
> \autocite[4, with some more text]{doe}
> =====================================
> 
> The problem is  that biblatex will add a label if the suffix consists 
> only of a number, a range of numbers, or a list of numbers. So 
> \autocite[4]{doe} will result (Doe 2021, p. 4). However, \autocite[4, 
> with some more text]{doe} results in (Doe 2021, 4, with some more text). 
> In this special case you'd have to help biblatex:
> \autocite[\pnfmt{4}, with some more text]{doe}
> => (Doe 2021, p. 4, with some more text)
> 
> FWIW, pandoc's citeproc already has some support for this. There you can 
> use braces to specify a locator in a complex suffix. Like so:
> [cite:@doe {4}, with some more text]
> 
> I don't know how complex that is, but that would be a great addition.
> 
> Denis
> 
> 


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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-09-08 13:37 Suggestions for improved suffix parsing in oc-biblatex Denis Maier
  2021-09-20 11:08 ` Denis Maier
@ 2021-09-26 11:12 ` Bastien
  2021-09-28 11:41   ` Nicolas Goaziou
  1 sibling, 1 reply; 11+ messages in thread
From: Bastien @ 2021-09-26 11:12 UTC (permalink / raw)
  To: Denis Maier; +Cc: Org Mode List, Elias Bounatirou

Hi Denis,

Denis Maier <denismaier@mailbox.org> writes:

> I think the suffix parsing in oc-biblatex could be improved. 

Can you provide a patch for this?

-- 
 Bastien


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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-09-26 11:12 ` Bastien
@ 2021-09-28 11:41   ` Nicolas Goaziou
  2021-09-28 12:16     ` Bruce D'Arcus
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Goaziou @ 2021-09-28 11:41 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode List, Elias Bounatirou, Denis Maier

Hello,

Bastien <bzg@gnu.org> writes:

> Denis Maier <denismaier@mailbox.org> writes:
>
>> I think the suffix parsing in oc-biblatex could be improved. 
>
> Can you provide a patch for this?

I don't think this improvement is needed. We could get away with it in
most cases using, e.g., global suffix:

  [cite:@doe 4; with some more text]

Note the example above is not supported yet, but it might be a more
sensible development than

  [cite:@doe {4}, with some more text]

Regards,
-- 
Nicolas Goaziou


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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-09-28 11:41   ` Nicolas Goaziou
@ 2021-09-28 12:16     ` Bruce D'Arcus
  2021-09-29  6:30       ` Nicolas Goaziou
  0 siblings, 1 reply; 11+ messages in thread
From: Bruce D'Arcus @ 2021-09-28 12:16 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Bastien, Org Mode List, Elias Bounatirou, Denis Maier

On Tue, Sep 28, 2021 at 7:42 AM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>
> Hello,
>
> Bastien <bzg@gnu.org> writes:
>
> > Denis Maier <denismaier@mailbox.org> writes:
> >
> >> I think the suffix parsing in oc-biblatex could be improved.
> >
> > Can you provide a patch for this?
>
> I don't think this improvement is needed. We could get away with it in
> most cases using, e.g., global suffix:
>
>   [cite:@doe 4; with some more text]

That won't work if you have more than one reference in a citation?

[cite:@doe 4, with some more text; @jones]

> Note the example above is not supported yet, but it might be a more
> sensible development than
>
>   [cite:@doe {4}, with some more text]

I recall you're not thrilled with adding brackets for this purpose.

Any other ideas?

Bruce


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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-09-28 12:16     ` Bruce D'Arcus
@ 2021-09-29  6:30       ` Nicolas Goaziou
  2021-09-29  7:36         ` Denis Maier
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Goaziou @ 2021-09-29  6:30 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: Bastien, Org Mode List, Elias Bounatirou, Denis Maier

Hello,

"Bruce D'Arcus" <bdarcus@gmail.com> writes:

> That won't work if you have more than one reference in a citation?
>
> [cite:@doe 4, with some more text; @jones]

No, that won't work with more than one reference in a citation. But
this, coupled with the simple locator parsing done in oc-csl.el should
be enough in the vast majority of the cases, shouldn't it?

Regards,
-- 
Nicolas Goaziou


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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-09-29  6:30       ` Nicolas Goaziou
@ 2021-09-29  7:36         ` Denis Maier
  2021-09-30  7:23           ` Nicolas Goaziou
  0 siblings, 1 reply; 11+ messages in thread
From: Denis Maier @ 2021-09-29  7:36 UTC (permalink / raw)
  To: Nicolas Goaziou, Bruce D'Arcus
  Cc: Bastien, Org Mode List, Elias Bounatirou

Am 29.09.2021 um 08:30 schrieb Nicolas Goaziou:
> Hello,
>
> "Bruce D'Arcus" <bdarcus@gmail.com> writes:
>
>> That won't work if you have more than one reference in a citation?
>>
>> [cite:@doe 4, with some more text; @jones]
> No, that won't work with more than one reference in a citation. But
> this, coupled with the simple locator parsing done in oc-csl.el should
> be enough in the vast majority of the cases, shouldn't it?
Well, there are even cases like this one:

[cite:@doe especially 4, 12, and 15]

[cite:@doe e.g. 4, 12, and 15]

[cite:@doe among others 4, 12, and 15]

[cite:@doe 4, but also 12 and 15]

Best,
Denis



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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-09-29  7:36         ` Denis Maier
@ 2021-09-30  7:23           ` Nicolas Goaziou
  2021-09-30 16:14             ` Denis Maier
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Goaziou @ 2021-09-30  7:23 UTC (permalink / raw)
  To: Denis Maier; +Cc: Bastien, Org Mode List, Bruce D'Arcus, Elias Bounatirou

Hello,

Denis Maier <denismaier@mailbox.org> writes:

> Well, there are even cases like this one:
>
> [cite:@doe especially 4, 12, and 15]
>
> [cite:@doe e.g. 4, 12, and 15]
>
> [cite:@doe among others 4, 12, and 15]
>
> [cite:@doe 4, but also 12 and 15]

AFAIU, all these cases are already handled by the locator parsing
algorithm used in oc-csl.el. If that is correct, my point is still the
same: there are very few cases where an explicit locator delimiter would
be necessary.

Note that for clarity, it would help to also specify, along with your
examples, what is the expected locator, and possibly the expected
output.


Regards,
-- 
Nicolas Goaziou


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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-09-30  7:23           ` Nicolas Goaziou
@ 2021-09-30 16:14             ` Denis Maier
  2021-10-01  8:42               ` Nicolas Goaziou
  0 siblings, 1 reply; 11+ messages in thread
From: Denis Maier @ 2021-09-30 16:14 UTC (permalink / raw)
  To: Nicolas Goaziou
  Cc: Bruce D'Arcus, Bastien, Org Mode List, Elias Bounatirou



Am 30.09.2021 um 09:23 schrieb Nicolas Goaziou:
> Hello,
>
> Denis Maier <denismaier@mailbox.org> writes:
>
>> Well, there are even cases like this one:
>>
>> [cite:@doe especially 4, 12, and 15]
>>
>> [cite:@doe e.g. 4, 12, and 15]
>>
>> [cite:@doe among others 4, 12, and 15]
>>
>> [cite:@doe 4, but also 12 and 15]
> AFAIU, all these cases are already handled by the locator parsing
> algorithm used in oc-csl.el. If that is correct, my point is still the
> same: there are very few cases where an explicit locator delimiter would
> be necessary.

So, you're suggesting that locator parsing algorithm should be ported to 
oc-biblatex instead? That would obviously be a neat solution.
If so, I can provide a couple of examples so we can see if that could work.

Denis



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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-09-30 16:14             ` Denis Maier
@ 2021-10-01  8:42               ` Nicolas Goaziou
  2021-10-01  8:46                 ` Denis Maier
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Goaziou @ 2021-10-01  8:42 UTC (permalink / raw)
  To: Denis Maier; +Cc: Bastien, Org Mode List, Bruce D'Arcus, Elias Bounatirou

Hello,

Denis Maier <denismaier@mailbox.org> writes:

> So, you're suggesting that locator parsing algorithm should be ported
> to oc-biblatex instead?

That's a possibility. It can be factored out from oc-csl.el and become
a generic tool living in oc.el, if deemed useful. The algorithm can trip
over locators involving letters, tho (e.g., "chap. xiv, xv and xvi").
I don't know if that's common.

Moreover this is but one side of the problem. Naively, I thought that
BibLaTeX would take care of parsing the locator. Since that's not the
case, oc-biblatex needs additional code to properly deal with it.

Regards,
-- 
Nicolas Goaziou


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

* Re: Suggestions for improved suffix parsing in oc-biblatex
  2021-10-01  8:42               ` Nicolas Goaziou
@ 2021-10-01  8:46                 ` Denis Maier
  0 siblings, 0 replies; 11+ messages in thread
From: Denis Maier @ 2021-10-01  8:46 UTC (permalink / raw)
  To: Nicolas Goaziou
  Cc: Bruce D'Arcus, Bastien, Org Mode List, Elias Bounatirou



Am 01.10.2021 um 10:42 schrieb Nicolas Goaziou:
> Hello,
>
> Denis Maier <denismaier@mailbox.org> writes:
>
>> So, you're suggesting that locator parsing algorithm should be ported
>> to oc-biblatex instead?
> That's a possibility. It can be factored out from oc-csl.el and become
> a generic tool living in oc.el, if deemed useful. The algorithm can trip
> over locators involving letters, tho (e.g., "chap. xiv, xv and xvi").
> I don't know if that's common.
Not so much for chapters, but it happens quite a lot for page numbers in 
prefaces and introductions.
>
> Moreover this is but one side of the problem. Naively, I thought that
> BibLaTeX would take care of parsing the locator. Since that's not the
> case, oc-biblatex needs additional code to properly deal with it.
Yes, that's the issue. In biblatex you will want to enclose the locator 
with \pnfmt{}. (Or use either the \pno or the \ppno command as a prefix.)

Best,
Denis



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

end of thread, other threads:[~2021-10-01  8:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-08 13:37 Suggestions for improved suffix parsing in oc-biblatex Denis Maier
2021-09-20 11:08 ` Denis Maier
2021-09-26 11:12 ` Bastien
2021-09-28 11:41   ` Nicolas Goaziou
2021-09-28 12:16     ` Bruce D'Arcus
2021-09-29  6:30       ` Nicolas Goaziou
2021-09-29  7:36         ` Denis Maier
2021-09-30  7:23           ` Nicolas Goaziou
2021-09-30 16:14             ` Denis Maier
2021-10-01  8:42               ` Nicolas Goaziou
2021-10-01  8:46                 ` Denis Maier

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