From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mOb/K29F/2OO/wAAbAwnHQ (envelope-from ) for ; Wed, 01 Mar 2023 13:30:39 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iMDwKm9F/2MjsQAAG6o9tA (envelope-from ) for ; Wed, 01 Mar 2023 13:30:39 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 70946237FE for ; Wed, 1 Mar 2023 13:30:38 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXLab-0000Eq-Fs; Wed, 01 Mar 2023 07:29:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXLaZ-0000Eb-LX for emacs-orgmode@gnu.org; Wed, 01 Mar 2023 07:29:43 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXLaW-00086H-V7 for emacs-orgmode@gnu.org; Wed, 01 Mar 2023 07:29:43 -0500 Received: by mail-wm1-x332.google.com with SMTP id c18so8429081wmr.3 for ; Wed, 01 Mar 2023 04:29:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew.cmu.edu; s=google-2021; t=1677673777; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ngr0KMj8rZtapAwLK2aRfaux/xWfHuoA6/eK+PlQcN4=; b=QVzI8oVOsggLGSvb15+hzEC0LY76LyQl2qxvNi0t9/5Lgk4yQ3fmankZ82+v/WLbM6 t5psBroLbMIYLLQXj5lIj6MGTPfQLEFE3S1hIfny1HxFMi82jhBAn1HTHqqov2REA50G b5beEGTbuOPqcq9lrqsuBj1UpGmjGgPKMDlpPTIZb/8PgS2cDIfmou5IqMBuy0whryPf kvtEO1KLYDaPlWK6A2DZdZwob9qSOicsvrorMRvHZpyVbG9eAVXPngoJw8wCO/NomYZZ YSqZfGJ0UOmqo7EP9ql8htITq4V4LwG+1QvW4FneSl8Fhn055bzsaP9pgafZ8XPwxGyC 3wxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677673777; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ngr0KMj8rZtapAwLK2aRfaux/xWfHuoA6/eK+PlQcN4=; b=WojVijsEPOhf5QtP1DbDCyb+YpCmpmkcvhDd+Xnxkymr/L2JGJmr4ay5CsKNBOzzrJ 3NSqy4sQhbIGHfta59yDvG5/ECPvfWFUROwfU80p9Bd0cTPnqhA75QxJ6SjLOoIuHksu Higp1Bb2jA06iLbCzUwDwfPGRN3pyOd/cWEuiRclFLM5lUnUjm3UZ3nPiENDpFy07jL2 0akwmM34Gx5eVsBhFjEZCkM7GcNr+Bn9LVeri293YLneb8lsQqqcMhDXIRnqVpyL9Mxt gu1HOuaTT22jdMIFHze9+7MXx213P5h7gmVtMtuDPS9IG5eFv8NWN6+9LizYJEa1uV2T exLw== X-Gm-Message-State: AO0yUKWsZcpphaL4JcbBBBDlpbGf0MnFg6uO4t7IcycJhTCLSyavYJdM +LjVaERYxM11chUQS+y2+sSkMq/AyU/w2sLGT0afzQwZVMbJwwmN X-Google-Smtp-Source: AK7set+S+OoOWoC6MuukR0Wi9rEkggSVjxua5RHnHXrUvfq3rlnsM5B1EnN6ndwYnYe+BiEYOMKOqQHcHnZJswm6Mgw= X-Received: by 2002:a05:600c:a3a2:b0:3e1:eddc:e3ae with SMTP id hn34-20020a05600ca3a200b003e1eddce3aemr1718602wmb.0.1677673776551; Wed, 01 Mar 2023 04:29:36 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: John Kitchin Date: Wed, 1 Mar 2023 07:29:25 -0500 Message-ID: Subject: Re: How to produce an org-ref citation from ivy-bibtex To: Sven Bretfeld Cc: Emacs Orgmode Content-Type: multipart/alternative; boundary="000000000000802f2b05f5d5dd38" Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=jkitchin@andrew.cmu.edu; helo=mail-wm1-x332.google.com X-Spam_score_int: 0 X-Spam_score: -0.0 X-Spam_bar: / X-Spam_report: (-0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.967 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677673839; a=rsa-sha256; cv=none; b=qkZYqQjBqxFfDxIhL6fxoMH22YYx5MJgTx3v/D1wH9zx0P6RGCkt3kq7N/J+1aROVNpFmJ cdkkkTjdy7WpcsAF/+uHbfR2zXHpfx3wAtyIkBP9SoC3oTHHqIpyx4VdU0UhmD16GrdF85 kDrCF7zD5QW1MaKUbjdKtB9dcE9SN6IiXQ/j+4JOF7oZVwbtvuswqPpqGF5YsenoYzwdJ4 7uAAhTvW7XabzFHHfDf99zpYPRb1Kdcj+sc0QTmwI23E3DRW5kk3k6tND1LgkpSco8DU77 Mq2Lzf39R+GuIxBio7vNUB4CCGF6x3lty5lhZuDk1Mx7EwZhXiFSz47PfpGZYg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=QVzI8oVO; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=andrew.cmu.edu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677673839; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Ngr0KMj8rZtapAwLK2aRfaux/xWfHuoA6/eK+PlQcN4=; b=PHNwOn6QT7+x4fdYTzQYGwElTU4qrXXC6/UT5c4quqSzyE5iCDSX92sJLFC0Jrh9Y8S4HH kWFBdLIhYolBPn3bUSNTDWRNPZF0yvkix2Lb2aO8UKOPQmbup8kaK8SQs6QnQXJ+yiesIs OQFJa2i9woFJnyDxBGIyCVkqxzm/i/C2KArdqF35bMyxMjws2HdwF1CC2fm8krPO9lhDc6 zFg2cG39YhK8abKVj4Qy49ZwSVKE9lgoRz6YWDedGtFzozr6KSQabkA6aHX/RGuj8Nb3in FTQlZq4SV1haqAaADOlhLCeHTCvrMKDZoOZr/X8oAQbhdAN8U19te0++zsgVTw== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.94 X-Spam-Score: -4.94 X-Migadu-Queue-Id: 70946237FE Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=QVzI8oVO; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=andrew.cmu.edu X-TUID: NgXw4eQG1AQp --000000000000802f2b05f5d5dd38 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The best place to report org-ref issues is https://github.com/jkitchin/org-ref/issues. On Wed, Mar 1, 2023 at 7:25=E2=80=AFAM Sven Bretfeld wrote: > Hi John > > Thank you very much again. Elegant solution, and it works. > > I just wonder why I seem to be the only one on the list who had that > problem. Am I so out of fashion to use org-ref and ivy/helm-bibtex > together? I have been doing that for surely 10 years but had to stick > with an old version of org-ref until recently (because of a completely > different problem that I will post in another thread). > > Have a nice day, > > Sven > > > Am Tue, Feb 28, 2023 at 12:07:35PM -0500 schrieb John Kitchin: > > You can try something like this > > > > #+BEGIN_SRC emacs-lisp > > (setq bibtex-completion-format-citation-functions > > '((org-mode . (lambda (keys) (org-ref-insert-cite-keys keys) > "")) > > (latex-mode . bibtex-completion-format-citation-cite) > > (markdown-mode . > bibtex-completion-format-citation-pandoc-citeproc) > > (default . bibtex-completion-format-citation-default))) > > #+END_SRC > > > > it seems like ivy-bibtex at least expects some kind of string to be > returned, > > but org-ref-insert-cite-keys does the insertion for you. > > > > On Sun, Feb 26, 2023 at 11:19 AM Sven Bretfeld <[1]sven.bretfeld@ntnu.n= o > > > > wrote: > > > > Hi everybody > > > > Is it at all possible to produce a correct org-ref citation format > > from ivy-bibtex (or helm-bibtex, I tried both)? What I mean by > > "correct" is the format: [[cite:&citekey]]. > > > > The problem seems to come down to the question what has to be > inserted > > in the 2nd line here: > > > > (setq bibtex-completion-format-citation-functions > > '((org-mode . ??????) > > (latex-mode . bibtex-completion-format-citation-cite) > > (markdown-mode . > bibtex-completion-format-citation-pandoc-citeproc) > > (default . bibtex-completion-format-citation-default)= )) > > > > (A) Not setting the variable at all, defaults to producing an ebib > > link which is of no use to me at all. > > > > (B) Putting org-ref-helm-bibtex-insert-citation here (as found on > > reddit) does not work, since the function does not seem to exist > > anymore. > > > > (C) Putting org-ref-insert-cite-link here is obviously wrong. > Choosing > > that from the list of ivy-bibtex-actions, just calls the function > > interactively, you have to search for the bib-entry again and the > > resulting link looks like: [[cite:&citekey]]^&. The terminating '^&= ' > > obviously makes subsequent LaTeX-exports fall. > > > > (D) Putting "bibtex-completion-format-citation-org-cite" here, > > produces standard org-links: [cite:@citekey]. These are not > correctly > > exported to a tex file when the org-ref package is loaded. > > > > The only working solution I have found is to use org-ref's own cite > > function org-ref-insert-cite-link. I know that ivy-bibtex can be se= t > > as backend (require 'org-ref-ivy). But in this way ivy-bibtex's oth= er > > actions (like opening an associated PDF or note file) are lost. > > > > It would be nice to be able to use a SINGLE key-binding to select a > > bib-entry and then decide what to do with it (insert org reference, > > insert tex reference, open pdf, etc.). This was possible earlier (I > > did that for years with older versions of org-ref-helm) but is > > apparently no longer possible now. > > > > Many thanks for help and suggestions, > > > > Sven > > > > > > > > References: > > > > [1] mailto:sven.bretfeld@ntnu.no > > --=20 ohn ----------------------------------- Professor John Kitchin (he/his) Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 https://kitchingroup.cheme.cmu.edu https://pointbreezepubs.gumroad.com/ pycse bookstore --000000000000802f2b05f5d5dd38 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The best place to report org-ref issues is=C2=A0https://github.com/jkitchin/or= g-ref/issues.

On Wed, Mar 1, 2023 at 7:25=E2=80=AFAM Sven Bretfeld <<= a href=3D"mailto:sven.bretfeld@ntnu.no">sven.bretfeld@ntnu.no> wrote= :
Hi John

Thank you very much again. Elegant solution, and it works.

I just wonder why I seem to be the only one on the list who had that
problem. Am I so out of fashion to use org-ref and ivy/helm-bibtex
together? I have been doing that for surely 10 years but had to stick
with an old version of org-ref until recently (because of a completely
different problem that I will post in another thread).

Have a nice day,

Sven


Am Tue, Feb 28, 2023 at 12:07:35PM -0500 schrieb John Kitchin:
> You can try something like this
>
> #+BEGIN_SRC emacs-lisp
> (setq bibtex-completion-format-citation-functions
>=C2=A0 =C2=A0 =C2=A0 =C2=A0'((org-mode=C2=A0 =C2=A0 =C2=A0 . (lambd= a (keys) (org-ref-insert-cite-keys keys) ""))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(latex-mode=C2=A0 =C2=A0 . bibtex-com= pletion-format-citation-cite)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(markdown-mode . bibtex-completion-fo= rmat-citation-pandoc-citeproc)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(default=C2=A0 =C2=A0 =C2=A0 =C2=A0. = bibtex-completion-format-citation-default)))
> #+END_SRC
>
> it seems like ivy-bibtex at least expects some kind of string to be re= turned,
> but org-ref-insert-cite-keys does the insertion for you.
>
> On Sun, Feb 26, 2023 at 11:19 AM Sven Bretfeld <[1]sven.bretfeld@ntnu.no> > wrote:
>
>=C2=A0 =C2=A0 =C2=A0Hi everybody
>
>=C2=A0 =C2=A0 =C2=A0Is it at all possible to produce a correct org-ref = citation format
>=C2=A0 =C2=A0 =C2=A0from ivy-bibtex (or helm-bibtex, I tried both)? Wha= t I mean by
>=C2=A0 =C2=A0 =C2=A0"correct" is the format: [[cite:&cite= key]].
>
>=C2=A0 =C2=A0 =C2=A0The problem seems to come down to the question what= has to be inserted
>=C2=A0 =C2=A0 =C2=A0in the 2nd line here:
>
>=C2=A0 =C2=A0 =C2=A0(setq bibtex-completion-format-citation-functions >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'((org-mode=C2=A0 =C2=A0 = =C2=A0 . ??????)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(latex-mode=C2=A0 =C2= =A0 . bibtex-completion-format-citation-cite)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(markdown-mode . bibtex= -completion-format-citation-pandoc-citeproc)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(default=C2=A0 =C2=A0 = =C2=A0 =C2=A0. bibtex-completion-format-citation-default)))
>
>=C2=A0 =C2=A0 =C2=A0(A) Not setting the variable at all, defaults to pr= oducing an ebib
>=C2=A0 =C2=A0 =C2=A0link which is of no use to me at all.
>
>=C2=A0 =C2=A0 =C2=A0(B) Putting org-ref-helm-bibtex-insert-citation her= e (as found on
>=C2=A0 =C2=A0 =C2=A0reddit) does not work, since the function does not = seem to exist
>=C2=A0 =C2=A0 =C2=A0anymore.
>
>=C2=A0 =C2=A0 =C2=A0(C) Putting org-ref-insert-cite-link here is obviou= sly wrong. Choosing
>=C2=A0 =C2=A0 =C2=A0that from the list of ivy-bibtex-actions, just call= s the function
>=C2=A0 =C2=A0 =C2=A0interactively, you have to search for the bib-entry= again and the
>=C2=A0 =C2=A0 =C2=A0resulting link looks like: [[cite:&citekey]]^&a= mp;. The terminating '^&'
>=C2=A0 =C2=A0 =C2=A0obviously makes subsequent LaTeX-exports fall.
>
>=C2=A0 =C2=A0 =C2=A0(D) Putting "bibtex-completion-format-citation= -org-cite" here,
>=C2=A0 =C2=A0 =C2=A0produces standard org-links: [cite:@citekey]. These= are not correctly
>=C2=A0 =C2=A0 =C2=A0exported to a tex file when the org-ref package is = loaded.
>
>=C2=A0 =C2=A0 =C2=A0The only working solution I have found is to use or= g-ref's own cite
>=C2=A0 =C2=A0 =C2=A0function org-ref-insert-cite-link. I know that ivy-= bibtex can be set
>=C2=A0 =C2=A0 =C2=A0as backend (require 'org-ref-ivy). But in this = way ivy-bibtex's other
>=C2=A0 =C2=A0 =C2=A0actions (like opening an associated PDF or note fil= e) are lost.
>
>=C2=A0 =C2=A0 =C2=A0It would be nice to be able to use a SINGLE key-bin= ding to select a
>=C2=A0 =C2=A0 =C2=A0bib-entry and then decide what to do with it (inser= t org reference,
>=C2=A0 =C2=A0 =C2=A0insert tex reference, open pdf, etc.). This was pos= sible earlier (I
>=C2=A0 =C2=A0 =C2=A0did that for years with older versions of org-ref-h= elm) but is
>=C2=A0 =C2=A0 =C2=A0apparently no longer possible now.
>
>=C2=A0 =C2=A0 =C2=A0Many thanks for help and suggestions,
>
>=C2=A0 =C2=A0 =C2=A0Sven
>
>
>
> References:
>
> [1] mailto:= sven.bretfeld@ntnu.no



--
ohn

--------------------= ---------------
Professor John Kitchin (he/his)
Doherty Hall A207FDepartment of Chemical Engineering
Carnegie Mellon University
Pittsb= urgh, PA 15213
412-268-7803
https://kitchingroup.cheme.cmu.edu
https://pointbr= eezepubs.gumroad.com/=C2=A0pycse bookstore
--000000000000802f2b05f5d5dd38--