[Top][All Lists]

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

Re: help with a regexp

From: John Kitchin
Subject: Re: help with a regexp
Date: Thu, 15 Jul 2021 08:58:15 -0400
User-agent: mu4e 1.4.15; emacs 27.2

Thanks everyone, these are all good suggestions.

I realized though the problem is that org-mode is recognizing something
like [cite:@darby-2018-lonel-atoms] as a cite link because of the cite:
part of it. In fact org-mode seems to recognize all [link:path] as an
org link.

In general that seems ok, but it leads to overlapping syntax with
org-cite and the one org-ref link.

It seems to be a partial solution to remove the cite link from
org-link-parameters, but that isn't ideal to me because older documents
won't work with org-ref that way (most of mine use cite: very

The best solution in my opinion would be for org-mode to not recognize
[cite:...] as a link. Other ideas?


Stephen Berman <stephen.berman@gmx.net> writes:

> On Wed, 14 Jul 2021 20:43:24 -0400 John Kitchin <jkitchin@andrew.cmu.edu> 
> wrote:
>> Hi all, I could use a bit of help with a regexp. I am trying to fine tune 
>> the org-ref citation regexp to
>> make it orthogonal to org-cite.
>> I want to recognize these as org-ref links
>> [[cite:schuett-2018-schnet]]
>>    cite:schuett-2018-schnet
>> but not
>>  [cite:@schuett-2018-schnet]
>> so either 0 or 2 [[ can prefix it to be a cite link in org-ref, but not 1 [.
>> right now the cite: in the org-cite syntax is getting flagged as bad cite 
>> link which I want to avoid.
>> is this doable?
> For your example this is sufficient (for real usage you probably want to
> add more context to the right of 'cite'):
> (re-search-forward "\\[\\[cite:\\|[^[]cite:")
> Steve Berman

Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
Pronouns: he/him/his

reply via email to

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