emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Edgar Lux <edgarlux@mailfence.com>,
	Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite
Date: Mon, 23 Jan 2023 11:06:40 +0000	[thread overview]
Message-ID: <87tu0h5x33.fsf@localhost> (raw)
In-Reply-To: <865655434.1045612.1674415160995@fidget.co-bxl>

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	other threads:[~2023-01-23 11:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu0h5x33.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=edgarlux@mailfence.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).