emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-


From: Ihor Radchenko
Subject: Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
Date: Mon, 23 Jan 2023 11:06:40 +0000

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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]