emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
@ 2023-01-18 21:31 Edgar Lux
  2023-01-20 10:59 ` Ihor Radchenko
  2023-01-21  8:37 ` Ihor Radchenko
  0 siblings, 2 replies; 16+ messages in thread
From: Edgar Lux @ 2023-01-18 21:31 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

I send the attached patch for your consideration. It allows to use biber for bibliographies. I tested it with this:

(require 'oc-natbib)

#+cite_export: natbib
#+LaTeX_HEADER: \usepackage[style=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true]{biblatex}
#+LaTeX_HEADER: \addbibresource{../../Sources/sources.bib}

[cite:@mytest]

\printbibliography[heading=none]

These won't work
#+bibliography:
#+print_bibliography:

Thank you very much.

-- 
Sent with https://mailfence.com  
Secure and private email


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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-18 21:31 Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite Edgar Lux
@ 2023-01-20 10:59 ` Ihor Radchenko
  2023-01-20 16:57   ` Edgar Lux
  2023-01-21  8:37 ` Ihor Radchenko
  1 sibling, 1 reply; 16+ messages in thread
From: Ihor Radchenko @ 2023-01-20 10:59 UTC (permalink / raw)
  To: Edgar Lux; +Cc: emacs-orgmode

Edgar Lux <edgarlux@mailfence.com> writes:

> I send the attached patch for your consideration. It allows to use biber for bibliographies. I tested it with this:

Thanks, but could you please attach the patch?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-20 10:59 ` Ihor Radchenko
@ 2023-01-20 16:57   ` Edgar Lux
  0 siblings, 0 replies; 16+ messages in thread
From: Edgar Lux @ 2023-01-20 16:57 UTC (permalink / raw)
  To: emacs-orgmode

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

LOL What an idio...! (sorry)

January 20, 2023 at 11:59:22 AM CET Ihor Radchenko <yantar92@posteo.net> wrote:Edgar Lux <edgarlux@mailfence.com> writes:

> I send the attached patch for your consideration. It allows to use biber for
bibliographies. I tested it with this:

Thanks, but could you please attach the patch?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

-- 
Sent with https://mailfence.com  
Secure and private email

[-- Attachment #2: File Attachment: oc-natbib.el.patch.gz --]
[-- Type: application/gzip, Size: 506 bytes --]

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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-18 21:31 Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite Edgar Lux
  2023-01-20 10:59 ` Ihor Radchenko
@ 2023-01-21  8:37 ` Ihor Radchenko
  2023-01-21 20:25   ` Edgar Lux
  1 sibling, 1 reply; 16+ messages in thread
From: Ihor Radchenko @ 2023-01-21  8:37 UTC (permalink / raw)
  To: Edgar Lux; +Cc: emacs-orgmode

Edgar Lux <edgarlux@mailfence.com> writes:

> I send the attached patch for your consideration. It allows to use biber for bibliographies. I tested it with this:
>
> (require 'oc-natbib)
>
> #+cite_export: natbib
> #+LaTeX_HEADER: \usepackage[style=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true]{biblatex}
> #+LaTeX_HEADER: \addbibresource{../../Sources/sources.bib}

I now looked at the patch and I have one general question. What you
don't just use oc-biblatex in the above?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-21  8:37 ` Ihor Radchenko
@ 2023-01-21 20:25   ` Edgar Lux
  2023-01-22 11:15     ` Ihor Radchenko
  0 siblings, 1 reply; 16+ messages in thread
From: Edgar Lux @ 2023-01-21 20:25 UTC (permalink / raw)
  To: emacs-orgmode

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

For the very silly reason that I was not aware of it >.< . Thank you, Ihor. 

For the uninformed: evaluate this as a lisp expression (require 'oc-biblatex) . Also, you can use either  #+LaTeX_HEADER: \usepackage... (like shown in this thread) or style options with #+cite_export: biblatex (read the documentation for oc-biblatex.el). I tested like this (and with the \usepackage line too):

    #+cite_export: biblatex
    #+bibliography: your_file.bib

This:

    #+cite_export: biblatex "bibstyle=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true"

will create

    \usepackage[style=bibstyle=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true]{biblatex}

(note the style=bibstyle=)

I would suggest that the org-info pages mention (require 'oc-biblatex) and show an example of  how one can use extra options (with the #+latex_header as well). Further, may be it would be better to allow something like this:

    #+cite_export: biblatex "bibstyle=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true"
    #+bibliography: your_file.bib

For which one can use the appended patch, which may break other things, of course :P . The gain is control over biblatex options without resorting to #+latex_header: \usepackage[...]{biblatex}

Cheers! Thanks.

January 21, 2023 at 9:37:18 AM CET Ihor Radchenko <yantar92@posteo.net> wrote:Edgar Lux <edgarlux@mailfence.com> writes:

I now looked at the patch and I have one general question. What you
don't just use oc-biblatex in the above?


-- 
Sent with https://mailfence.com  
Secure and private email

[-- Attachment #2: File Attachment: oc-biblatex.patch.gz --]
[-- Type: application/gzip, Size: 325 bytes --]

[-- Attachment #3: File Attachment: oc-biblatex-postpatch-tests.txt.gz --]
[-- Type: application/gzip, Size: 274 bytes --]

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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-21 20:25   ` Edgar Lux
@ 2023-01-22 11:15     ` Ihor Radchenko
  2023-01-22 11:36       ` András Simonyi
  2023-01-22 19:19       ` Edgar Lux
  0 siblings, 2 replies; 16+ messages in thread
From: Ihor Radchenko @ 2023-01-22 11:15 UTC (permalink / raw)
  To: Edgar Lux; +Cc: emacs-orgmode

Edgar Lux <edgarlux@mailfence.com> writes:

> I would suggest that the org-info pages mention (require 'oc-biblatex) and show an example of  how one can use extra options (with the #+latex_header as well). Further, may be it would be better to allow something like this:

Note that we have https://orgmode.org/manual/Citation-export-processors.html
Of course, the "Citations" section of the manual is not yet complete.
More examples and details will be welcome.

>     #+cite_export: biblatex "bibstyle=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true"

The general design is
#+cite_export: NAME BIBLIOGRAPHY-STYLE CITATION-STYLE

There, NAME is the name of a registered citation processor providing export
functionality, as a symbol.  BIBLIOGRAPHY-STYLE (respectively CITATION-STYLE)
is the desired default style to use when printing a bibliography (respectively
exporting a citation), as a string or nil.  Both BIBLIOGRAPHY-STYLE and
CITATION-STYLE are optional.  NAME is mandatory.

I am not sure how your idea fits the above.

Also, note that `org-cite-biblatex--package-options' combines INITIAL
option list from the \usepackage declaration already present with
options dictated by STYLE. However, only certain options are considered.
After applying your patch, things may be broken in this area.

P.S. Could you please send patches as plain text? They are easier to
view then.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-22 11:15     ` Ihor Radchenko
@ 2023-01-22 11:36       ` András Simonyi
  2023-01-22 19:47         ` Edgar Lux
  2023-01-22 19:19       ` Edgar Lux
  1 sibling, 1 reply; 16+ messages in thread
From: András Simonyi @ 2023-01-22 11:36 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Edgar Lux, emacs-orgmode

Dear All,

On Sun, 22 Jan 2023 at 12:15, Ihor Radchenko <yantar92@posteo.net> wrote:

> Also, note that `org-cite-biblatex--package-options' combines INITIAL
> option list from the \usepackage declaration already present with
> options dictated by STYLE. However, only certain options are considered.
> After applying your patch, things may be broken in this area.

There is also the customizable variable `org-cite-biblatex-options' to
pass additional options,
which could be used with #bind+ if document-specific options are needed.

best wishes,
András

> P.S. Could you please send patches as plain text? They are easier to
> view then.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-22 11:15     ` Ihor Radchenko
  2023-01-22 11:36       ` András Simonyi
@ 2023-01-22 19:19       ` Edgar Lux
  2023-01-23 11:06         ` Ihor Radchenko
  1 sibling, 1 reply; 16+ messages in thread
From: Edgar Lux @ 2023-01-22 19:19 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

January 22, 2023 at 12:15:14 PM CET Ihor Radchenko <yantar92@posteo.net> wrote:Edgar Lux <edgarlux@mailfence.com> writes:
> Note that we have https://orgmode.org/manual/Citation-export-processors.html
> Of course, the "Citations" section of the manual is not yet complete.
> More examples and details will be welcome.

Yes, indeed

> >     #+cite_export: biblatex "bibstyle=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true"
>
> The general design is
> #+cite_export: NAME BIBLIOGRAPHY-STYLE CITATION-STYLE
> ... removed content ...
> I am not sure how your idea fits the above.

The general design only allows two options (and their values) to be passed to =biblatex= (in the =#+cite_export:= line): =bibstyle= and =citestyle=. However, =biblatex= can take many more options. Currently (correct me if I am wrong), the two alternatives to pass more options is to use a =org-cite-biblatex-options= or a line like this

#+begin_src org
  ,#+LaTeX_HEADER: \usepackage[bibstyle=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true]{biblatex}
#+end_src

> Also, note that `org-cite-biblatex--package-options' combines INITIAL
> option list from the \usepackage declaration already present with
> options dictated by STYLE.

Precisely.

> However, only certain options are considered.
> After applying your patch, things may be broken in this area.

One of the attachments showed what I considered to be all possible cases: the new string (containing =style==; it could be either =bibstyle==, =citestyle==. It is similar to the case which allows for ="bibstyle/citestyle"=, as documented on line 34 of =oc-biblatex.el=). Currently (these could, hopefully, also be used for the documentation), if somebody uses

1. case
   #+begin_src org
     #+cite_export: biblatex "how/much"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[bibstyle=how,citestyle=much]{biblatex}
   #+end_src

2. case
   #+begin_src org
     #+cite_export: biblatex "how" "much"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[style=how]{biblatex}
   #+end_src

3. case
   #+begin_src org
     #+cite_export: biblatex "how,opt=true"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[style=how,opt=true]{biblatex}
   #+end_src

4. case
   #+begin_src org
     #+cite_export: biblatex "how/much,hack=true"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[bibstyle=how,citestyle=much,hack=true]{biblatex}
   #+end_src

5. case
   #+begin_src org
     #+cite_export: biblatex "citestyle=corner/much"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[bibstyle=citestyle=corner,citestyle=much]{biblatex}
   #+end_src

6. case
   #+begin_src org
     #+cite_export: biblatex "citestyle=corner/much,opt=true"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[bibstyle=citestyle=corner,citestyle=much,opt=true]{biblatex}
   #+end_src

7. case
   #+begin_src org
     #+cite_export: biblatex "bibstyle=corner"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[style=bibstyle=corner]{biblatex}
   #+end_src

8. case
   #+begin_src org
     #+cite_export: biblatex "bibstyle=corner/much"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[bibstyle=bibstyle=corner,citestyle=much]{biblatex}
   #+end_src

9. case
   #+begin_src org
     #+cite_export: biblatex "[bibstyle=corner/much]"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[bibstyle=[bibstyle=corner,citestyle=much]]{biblatex}
   #+end_src

10. case (note that this can be combined with all the above)
    #+begin_src emacs-lisp
      (setq org-cite-biblatex-options "nulloption=true")
    #+end_src

    #+begin_src org
      #+cite_export: biblatex "how/much"
    #+end_src

    the result is
    #+begin_src latex
      \usepackage[nulloption=true,bibstyle=how,citestyle=much]{biblatex}
    #+end_src

whether some of these are broken is up for discussion. The suggested patch adds one conditional case, which searches for ="syle="=, takes away the brackets and turns the above cases into:

1. case
   #+begin_src org
     #+cite_export: biblatex "how/much"
   #+end_src

   same result as above

2. case
   #+begin_src org
     #+cite_export: biblatex "how" "much"
   #+end_src

   same result as above

3. case
   #+begin_src org
     #+cite_export: biblatex "how,opt=true"
   #+end_src

   same result as above

4. case
   #+begin_src org
     #+cite_export: biblatex "how/much,hack=true"
   #+end_src

   same result as above

5. case
   #+begin_src org
     #+cite_export: biblatex "citestyle=corner/much"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[citestyle=corner,citestyle=much]{biblatex}
   #+end_src

6. case
   #+begin_src org
     #+cite_export: biblatex "citestyle=corner/much,opt=true"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[citestyle=corner,citestyle=much,opt=true]{biblatex}
   #+end_src

7. case
   #+begin_src org
     #+cite_export: biblatex "bibstyle=corner"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[bibstyle=corner]{biblatex}
   #+end_src

8. case
   #+begin_src org
     #+cite_export: biblatex "bibstyle=corner/much"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[bibstyle=corner,citestyle=much]{biblatex}
   #+end_src

9. case
   #+begin_src org
     #+cite_export: biblatex "[bibstyle=corner/much]"
   #+end_src

   the result is
   #+begin_src latex
     \usepackage[bibstyle=corner,citestyle=much]{biblatex}
   #+end_src

10. case (note that this can be combined with all the above)
    #+begin_src emacs-lisp
      (setq org-cite-biblatex-options "nulloption=true")
    #+end_src

    #+begin_src org
      #+cite_export: biblatex "how/much"
    #+end_src

    same result as above

In this way, =org-cite-biblatex-options= is completely optional (an addendum to =#+cite_export: biblatex=), and more options (other than =bibstyle= and =citestyle=) can be added next to =#+cite_export: biblatex= (without hacks in between lines, as shown above).

Anyway! the "for your consideration" already implies something, and I can live with an extra =#+latex_header:=.

>
> P.S. Could you please send patches as plain text? They are easier to
> view then.

Sure. I hope that the code above suffices :) . I compress, because I don't have unlimited space in my account.

-- 
Sent with https://mailfence.com  
Secure and private email


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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-22 11:36       ` András Simonyi
@ 2023-01-22 19:47         ` Edgar Lux
  2023-01-23 10:43           ` Ihor Radchenko
  0 siblings, 1 reply; 16+ messages in thread
From: Edgar Lux @ 2023-01-22 19:47 UTC (permalink / raw)
  To: emacs-orgmode

January 22, 2023 at 12:36:32 PM CET "András Simonyi" <andras.simonyi@gmail.com> wrote:Dear All,

> There is also the customizable variable `org-cite-biblatex-options' to
> pass additional options,

That is very useful, indeed (I didn't know how to use it). Hopefully the e-mail which I just sent helps with the documentation.

> which could be used with #bind+ if document-specific options are needed.

Just in case, I think that you meant #+bind: . However, it didn't work for me (I'm blaming myself). I added this in line 16 of my 324-lines file

#+bind: org-cite-biblatex-options "opt=true"

but the =opt=true= value is not shown next to =\usepackage{biblatex}= when I export. I do have =org-export-allow-bind-keywords= set to =t=

> best wishes,
> András

you too!


-- 
Sent with https://mailfence.com  
Secure and private email


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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-22 19:47         ` Edgar Lux
@ 2023-01-23 10:43           ` Ihor Radchenko
  0 siblings, 0 replies; 16+ messages in thread
From: Ihor Radchenko @ 2023-01-23 10:43 UTC (permalink / raw)
  To: Edgar Lux; +Cc: emacs-orgmode

Edgar Lux <edgarlux@mailfence.com> writes:

> Just in case, I think that you meant #+bind: . However, it didn't work for me (I'm blaming myself). I added this in line 16 of my 324-lines file
>
> #+bind: org-cite-biblatex-options "opt=true"
>
> but the =opt=true= value is not shown next to =\usepackage{biblatex}= when I export. I do have =org-export-allow-bind-keywords= set to =t=

13.2 Export Settings
       If ‘org-export-allow-bind-keywords’ is non-‘nil’, Emacs variables can
    become buffer-local during export by using the ‘BIND’ keyword.  Its
    syntax is ‘#+BIND: variable value’.  This is particularly useful for
    in-buffer settings that cannot be changed using keywords.


#+BIND is ignored by default for safety reasons.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-22 19:19       ` Edgar Lux
@ 2023-01-23 11:06         ` Ihor Radchenko
  2023-01-23 20:58           ` Edgar Lux
  0 siblings, 1 reply; 16+ messages in thread
From: Ihor Radchenko @ 2023-01-23 11:06 UTC (permalink / raw)
  To: Edgar Lux, Nicolas Goaziou; +Cc: emacs-orgmode

Edgar Lux <edgarlux@mailfence.com> writes:

>> >     #+cite_export: biblatex "bibstyle=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true"
>>
>> The general design is
>> #+cite_export: NAME BIBLIOGRAPHY-STYLE CITATION-STYLE
>> ... removed content ...
>> I am not sure how your idea fits the above.
>
> The general design only allows two options (and their values) to be passed to =biblatex= (in the =#+cite_export:= line): =bibstyle= and =citestyle=. However, =biblatex= can take many more options. Currently (correct me if I am wrong), the two alternatives to pass more options is to use a =org-cite-biblatex-options= or a line like this
>
> #+begin_src org
>   ,#+LaTeX_HEADER: \usepackage[bibstyle=numeric-comp,sorting=none, hyperref=true,backref=true,url=true,backend=biber,natbib=true]{biblatex}
> #+end_src

So, what is the problem with LATEX_HEADER approach?

I do not like passing the options as-is in #+cite_export because not all
the possible biblatex \usepackage options are affecting the
bibliography. Options like sortcites, maxcitenames, autocite, etc are
only affecting the citation style, not the bibliography. And options
like bibencoding are totally irrelevant to both citation and
bibliography styles.

>> However, only certain options are considered.
>> After applying your patch, things may be broken in this area.
>
> One of the attachments showed what I considered to be all possible cases: the new string (containing =style==; it could be either =bibstyle==, =citestyle==. It is similar to the case which allows for ="bibstyle/citestyle"=, as documented on line 34 of =oc-biblatex.el=). Currently (these could, hopefully, also be used for the documentation), if somebody uses
>
> 1. case
>    #+begin_src org
>      #+cite_export: biblatex "how/much"
>    #+end_src
>
>    the result is
>    #+begin_src latex
>      \usepackage[bibstyle=how,citestyle=much]{biblatex}
>    #+end_src

This is actually confusing.
This code is by Nicolas, but does not seem to be consistent with the
idea of "BIBLIOGRAPHY STYLE".

I am CCing him in cause if there is something I am missing.

> 3. case
>    #+begin_src org
>      #+cite_export: biblatex "how,opt=true"
>    #+end_src
>
>    the result is
>    #+begin_src latex
>      \usepackage[style=how,opt=true]{biblatex}
>    #+end_src

> 4. case
>    #+begin_src org
>      #+cite_export: biblatex "how/much,hack=true"
>    #+end_src
>
>    the result is
>    #+begin_src latex
>      \usepackage[bibstyle=how,citestyle=much,hack=true]{biblatex}
>    #+end_src

This is an implementation detail. We cannot promise such things working
reliably.

> 5. case
>    #+begin_src org
>      #+cite_export: biblatex "citestyle=corner/much"
>    #+end_src
>
>    the result is
>    #+begin_src latex
>      \usepackage[bibstyle=citestyle=corner,citestyle=much]{biblatex}
>    #+end_src
>
> 6. case
>    #+begin_src org
>      #+cite_export: biblatex "citestyle=corner/much,opt=true"
>    #+end_src
> ...

This is plain abusing.
We might remove the "/" matching completely and throw an error if there
are commas inside style name. Users must not rely on such undocumented
behavior.

> whether some of these are broken is up for discussion. The suggested patch adds one conditional case, which searches for ="syle="=, takes away the brackets and turns the above cases into:

[I do not see any patch attached]

> Sure. I hope that the code above suffices :) . I compress, because I don't have unlimited space in my account.

Why not storing email locally? Account limits are non-issue then ;)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
  2023-01-23 11:06         ` Ihor Radchenko
@ 2023-01-23 20:58           ` Edgar Lux
  2023-01-24 10:54             ` [BUG] #+cite_export: ... bibstyle citestyle cannot be universally used as global defaults (was: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite) Ihor Radchenko
  0 siblings, 1 reply; 16+ messages in thread
From: Edgar Lux @ 2023-01-23 20:58 UTC (permalink / raw)
  To: emacs-orgmode

On Jan 23, 2023 at 12:06 PM, Ihor Radchenko <yantar92@posteo.net> wrote:Edgar Lux <edgarlux@mailfence.com> writes:
> So, what is the problem with LATEX_HEADER approach?

I thought that it would be preferable to have a native Org syntax.

> I do not like passing the options as-is in #+cite_export because not all
> the possible biblatex \usepackage options are affecting the
> bibliography. Options like sortcites, maxcitenames, autocite, etc are
> only affecting the citation style, not the bibliography. And options
> like bibencoding are totally irrelevant to both citation and
> bibliography styles.

That's fair, but it can just as well be used as a line to configure biblatex (since it is already being used anyway). Besides, there are many other options which do concern the style or are very needed (hyperref=true,backref=true,url=true,backend=biber,natbib=true). I'm not advocating for my suggestion, just showing my reasoning. As I said, I'm fine with the =#+latex_header:=.

> > 1. case
> >    #+begin_src org
> >      #+cite_export: biblatex "how/much"
> >    #+end_src
> >
> >    the result is
> >    #+begin_src latex
> >      \usepackage[bibstyle=how,citestyle=much]{biblatex}
> >    #+end_src
>
> This is actually confusing.
> This code is by Nicolas, but does not seem to be consistent with the
> idea of "BIBLIOGRAPHY STYLE".
>
> I am CCing him in cause if there is something I am missing.

The docstring says:

    ;; "cite_export" keyword.  If you need to use different styles for bibliography
    ;; and citations, you can separate them with "bibstyle/citestyle" syntax.  E.g.,
    ;;
    ;;   #+cite_export: biblatex authortitle/authortitle-ibid

> This is plain abusing.
> We might remove the "/" matching completely and throw an error if there
> are commas inside style name. Users must not rely on such undocumented
> behavior.

Let the user decide (?). If she gets to that point, she surely knows how to (ab)use it--in her favour.

> whether some of these are broken is up for discussion. The suggested patch
adds one conditional case, which searches for ="syle="=, takes away the
brackets and turns the above cases into:

[I do not see any patch attached]

WTF... again! (sorry)

    diff --git a/lisp/oc-biblatex.el b/lisp/oc-biblatex.el
    index a27f9e9bf..3e912f2d9 100644
    --- a/lisp/oc-biblatex.el
    +++ b/lisp/oc-biblatex.el
    @@ -99,6 +99,10 @@ Return a string."
             (style-options
              (cond
               ((null style) nil)
    +          ((string-match "style=" style)
    +           (list (replace-regexp-in-string
    +                  "\\(style=[^/]*\\)/" "\\1,citestyle="
    +                  (org-unbracket-string "[" "]" style))))
               ((not (string-match "/" style)) (list (concat "style=" style)))
               (t
                (list (concat "bibstyle=" (substring style nil (match-beginning 0)))

> Why not storing email locally? Account limits are non-issue then ;)

The server does not allow me to download e-mails! (free as in... half a beer. I can get the full beer if I pay for it, though). Thanks for the suggestion.


-- 
Sent with https://mailfence.com  
Secure and private email


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

* [BUG] #+cite_export: ... bibstyle citestyle cannot be universally used as global defaults (was: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite)
  2023-01-23 20:58           ` Edgar Lux
@ 2023-01-24 10:54             ` Ihor Radchenko
  2023-02-03  9:33               ` Edgar Lux
  0 siblings, 1 reply; 16+ messages in thread
From: Ihor Radchenko @ 2023-01-24 10:54 UTC (permalink / raw)
  To: Edgar Lux; +Cc: emacs-orgmode

Edgar Lux <edgarlux@mailfence.com> writes:

> I thought that it would be preferable to have a native Org syntax.
>
>> I do not like passing the options as-is in #+cite_export because not all
>> the possible biblatex \usepackage options are affecting the
>> bibliography. Options like sortcites, maxcitenames, autocite, etc are
>> only affecting the citation style, not the bibliography. And options
>> like bibencoding are totally irrelevant to both citation and
>> bibliography styles.
>
> That's fair, but it can just as well be used as a line to configure biblatex (since it is already being used anyway). Besides, there are many other options which do concern the style or are very needed (hyperref=true,backref=true,url=true,backend=biber,natbib=true). I'm not advocating for my suggestion, just showing my reasoning. As I said, I'm fine with the =#+latex_header:=.

I understand. My takeaway from here is that there is a need to provide
extended global defaults for both bibliography style and citation style.

>> This code is by Nicolas, but does not seem to be consistent with the
>> idea of "BIBLIOGRAPHY STYLE".
>>
>> I am CCing him in cause if there is something I am missing.
>
> The docstring says:
>
>     ;; "cite_export" keyword.  If you need to use different styles for bibliography
>     ;; and citations, you can separate them with "bibstyle/citestyle" syntax.  E.g.,
>     ;;
>     ;;   #+cite_export: biblatex authortitle/authortitle-ibid

Which is a questionable design choice. I was referring to higher-level
docstring for `org-cite-export-processors':

      (NAME BIBLIOGRAPHY-STYLE CITATION-STYLE)
    
    There, NAME is the name of a registered citation processor providing export
    functionality, as a symbol.  BIBLIOGRAPHY-STYLE (respectively CITATION-STYLE)
    is the desired default style to use when printing a bibliography (respectively
    exporting a citation), as a string or nil.  Both BIBLIOGRAPHY-STYLE and
    CITATION-STYLE are optional.  NAME is mandatory.

oc-biblatex simply deviates from the global paradigm, making oc-biblatex
special compared to other citation processors. Not ideal.

I think that we have a fundamental design flaw with org-cite:

    #+cite_export: processor bibliography-style citation-style

introduces:

 - default bibliography style set document-wide
 - default citation style set individually in every citation via
  low-level commands, BUT NOT GLOBAL DEFAULT CITATION STYLE.

Basically, CITATION_STYLE cannot currently affect document preamble by
design.

That's why awkward workarounds in oc-biblatex, where default citation
style can be set globally, and we have to attach citation style to
BIBLIOGRAPHY_STYLE keyword.

I suggest the following changes to the org-cite:

1. :export-finalizer should accept export processor triplet instead of
   bibliography style as 4th argument. The assumption that only
   bibliography style is required to finalize the export is clearly not
   accurate.

2. Allow passing extra arguments in #+cite_export:

    #+cite_export: processor[opt1=val1,opt2=val2,...] bibliography-style[...] citation-style[...]

  The options listed within the square brackets will pass extra default options
  to the processor/styles and used as needed by citation processor implementations.

WDYT?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] #+cite_export: ... bibstyle citestyle cannot be universally used as global defaults (was: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite)
  2023-01-24 10:54             ` [BUG] #+cite_export: ... bibstyle citestyle cannot be universally used as global defaults (was: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite) Ihor Radchenko
@ 2023-02-03  9:33               ` Edgar Lux
  2023-02-04 11:31                 ` Ihor Radchenko
  0 siblings, 1 reply; 16+ messages in thread
From: Edgar Lux @ 2023-02-03  9:33 UTC (permalink / raw)
  To: emacs-orgmode

On Jan 24, 2023 at 11:54 AM, Ihor Radchenko <yantar92@posteo.net> wrote:Edgar Lux <edgarlux@mailfence.com> writes:

> I understand. My takeaway from here is that there is a need to provide
> extended global defaults for both bibliography style and citation style.
> 
> Which is a questionable design choice. I was referring to higher-level
> docstring for `org-cite-export-processors':
> 
>       (NAME BIBLIOGRAPHY-STYLE CITATION-STYLE)
> 
>     There, NAME is the name of a registered citation processor providing
> export
>     functionality, as a symbol.  BIBLIOGRAPHY-STYLE (respectively
> CITATION-STYLE)
>     is the desired default style to use when printing a bibliography
> (respectively
>     exporting a citation), as a string or nil.  Both BIBLIOGRAPHY-STYLE and
>     CITATION-STYLE are optional.  NAME is mandatory.
> 
> oc-biblatex simply deviates from the global paradigm, making oc-biblatex
> special compared to other citation processors. Not ideal.
> 
> I think that we have a fundamental design flaw with org-cite:
> 
>     #+cite_export: processor bibliography-style citation-style
> 
> introduces:
> 
>  - default bibliography style set document-wide
>  - default citation style set individually in every citation via
>   low-level commands, BUT NOT GLOBAL DEFAULT CITATION STYLE.
> 
> Basically, CITATION_STYLE cannot currently affect document preamble by
> design.
> 
> That's why awkward workarounds in oc-biblatex, where default citation
> style can be set globally, and we have to attach citation style to
> BIBLIOGRAPHY_STYLE keyword.
> 
> I suggest the following changes to the org-cite:
> 
> 1. :export-finalizer should accept export processor triplet instead of
>    bibliography style as 4th argument. The assumption that only
>    bibliography style is required to finalize the export is clearly not
>    accurate.
> 
> 2. Allow passing extra arguments in #+cite_export:
> 
>     #+cite_export: processor[opt1=val1,opt2=val2,...] bibliography-style[...]
> citation-style[...]
> 
>   The options listed within the square brackets will pass extra default
> options
>   to the processor/styles and used as needed by citation processor
> implementations.
> 
> WDYT?
> -- 
> Ihor Radchenko // yantar92,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>

Dear Ihor and Org mailing list,

I wanted to answer last weekend, because I had the intention to contribute a little in terms of code. However, I was very busy, and I will be very busy this weekend as well. All in all, the idea sounds great. I appreciate that my opinion is taken into account, but I know very little about citation systems. I was only a bit concerned about the effort which is needed to implement the changes, as little as they may be. 



-- 
Sent with https://mailfence.com  
Secure and private email


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

* Re: [BUG] #+cite_export: ... bibstyle citestyle cannot be universally used as global defaults (was: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite)
  2023-02-03  9:33               ` Edgar Lux
@ 2023-02-04 11:31                 ` Ihor Radchenko
  2023-02-04 23:14                   ` Edgar Lux
  0 siblings, 1 reply; 16+ messages in thread
From: Ihor Radchenko @ 2023-02-04 11:31 UTC (permalink / raw)
  To: Edgar Lux; +Cc: emacs-orgmode

Edgar Lux <edgarlux@mailfence.com> writes:

> ... All in all, the idea sounds great. I appreciate that my opinion is taken into account, but I know very little about citation systems. I was only a bit concerned about the effort which is needed to implement the changes, as little as they may be. 

At this point, we should not jump into the implementation. Rather
discuss possible pros and cons.

For example, looking at my proposal now, I see how the proposed idea is
a bit awkward:

In #+cite_export: processor[opt1=val1,opt2=val2,...] bibliography-style[...] citation-style[...]

I assumed that there is one "major" bibliography-style/citation-style.
However, it is not really the case in practice. The styles are combined.

For example, adding links to bibliography to citations is applied
regardless of the particular citation command being used.

So, I am not leaning closer to only allowing options being passed to
"processor", but not to styles. This will at least come closer to
certain settings being citation package global config applied to
everything. If we have options applied to specific citation commands,
they will rather fit into citation-style/sub-style.

#+cite_export: processor[opt1=val1,opt2=val2,...] bibliography-style citation-style

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] #+cite_export: ... bibstyle citestyle cannot be universally used as global defaults (was: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite)
  2023-02-04 11:31                 ` Ihor Radchenko
@ 2023-02-04 23:14                   ` Edgar Lux
  0 siblings, 0 replies; 16+ messages in thread
From: Edgar Lux @ 2023-02-04 23:14 UTC (permalink / raw)
  To: emacs-orgmode

Dear Ihor,

On Feb 4, 2023 at 12:31 PM, Ihor Radchenko <yantar92@posteo.net> wrote:Edgar Lux <edgarlux@mailfence.com> writes:

> For example, ... the proposed idea is
> a bit awkward:
>
> ...
> #+cite_export: processor[opt1=val1,opt2=val2,...] bibliography-style[...]
> citation-style[...]
>
> I assumed that there is one "major" bibliography-style/citation-style.
> However, it is not really the case in practice. The styles are combined.

First of all, I quickly glanced at the other citation processors, and they seem to have been implemented with a different design in Org. This *may* have to do with biblatex being more advanced (disclaimer: I'm not saying that it actually is, it's a possibility only).

If the idea is that all processors are going to get the same syntax, I think that the implementation may not suit one of them. At that point, it may be that the filters will have to be adapted to specific processors in contrived ways. This of course will be much dependent on the choice of processors chosen to be supported by Org. Some other groups may decide to implement, for example, the JabRef #+cite_export (this does not imply that JabRef is a citation processor, it's just a colourful example).

> For example, adding links to bibliography to citations is applied
> regardless of the particular citation command being used.
>
> So, I am not leaning closer to only allowing options being passed to
> "processor", but not to styles. This will at least come closer to
> certain settings being citation package global config applied to
> everything. If we have options applied to specific citation commands,
> they will rather fit into citation-style/sub-style.
>
> #+cite_export: processor[opt1=val1,opt2=val2,...] bibliography-style
> citation-style

If it were me, I would consider just having the options as =#+cite_export: processor :options "anything"=. If the bibliography-style is important for the user and processor, may be default values can be provided; and let the user read some documentation option which are needed to run her particular processor (provided by them, not necessarily Org). Again, being completely honest, I don't think that you should put a dummy (like me) making these very relevant decisions.

-- 
Sent with https://mailfence.com  
Secure and private email


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

end of thread, other threads:[~2023-02-05  8:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18 21:31 Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite Edgar Lux
2023-01-20 10:59 ` Ihor Radchenko
2023-01-20 16:57   ` Edgar Lux
2023-01-21  8:37 ` Ihor Radchenko
2023-01-21 20:25   ` Edgar Lux
2023-01-22 11:15     ` Ihor Radchenko
2023-01-22 11:36       ` András Simonyi
2023-01-22 19:47         ` Edgar Lux
2023-01-23 10:43           ` Ihor Radchenko
2023-01-22 19:19       ` Edgar Lux
2023-01-23 11:06         ` Ihor Radchenko
2023-01-23 20:58           ` Edgar Lux
2023-01-24 10:54             ` [BUG] #+cite_export: ... bibstyle citestyle cannot be universally used as global defaults (was: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite) Ihor Radchenko
2023-02-03  9:33               ` Edgar Lux
2023-02-04 11:31                 ` Ihor Radchenko
2023-02-04 23:14                   ` Edgar Lux

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