public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John Purnell <johno108108-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Inserting citations into text editors
Date: Mon, 09 Jan 2023 09:36:23 +1300	[thread overview]
Message-ID: <3D58E4FE-7D6B-4012-A0D9-32C0C40985CF@gmail.com> (raw)
In-Reply-To: <4e64b509-7781-4511-856c-723daf2aae4fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

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

I also use Zotero with the BetterBibTeX extension on a Mac and make use 
of its provision of the Zotero citation selector in an AppleScript 
application which I have bound to a keyboard shortcut which inserts a 
Pandoc citation into any configured text editor. Here is the AppleScript 
in case it's of interest:

```
# Activates the Zotero Add Citation dialog in the specified text editor
# Requires the Better BibTex for Zotero plugin: 
https://retorque.re/zotero-better-bibtex

# 
==============================================================================
# Configuration Variables
# 
==============================================================================

# Debugging switch
global gBlnDebug

# Bundle ID of text editor
property pNameEditorBID : "com.sublimetext.4"

# 
==============================================================================
# Main Code
# 
==============================================================================

set gBlnDebug to false

try
	
	set txtZoteroStatus to do shell script ¬
		"/usr/bin/curl 'http://localhost:23119/better-bibtex/cayw?probe=1' 
2>/dev/null; exit 0"
	if txtZoteroStatus is "ready" then
		set txtCitation to do shell script ¬
			"/usr/bin/curl 
'http://localhost:23119/better-bibtex/cayw?format=pandoc&brackets=1' 
2>/dev/null; exit 0"
		# "/usr/bin/curl 
'http://localhost:23119/better-bibtex/cayw?format=pandoc&brackets=1&clipboard=1' 
2>/dev/null; exit 0"
		tell application id pNameEditorBID
			activate
			if not txtCitation is null then
				repeat while not frontmost
					tell me to delay 0.1
				end repeat
				tell application id "com.apple.systemevents" to keystroke 
txtCitation
				# tell application id "com.apple.systemevents" to keystroke "v" 
using command down
			end if
		end tell
	else
		tell application id "org.zotero.zotero" to activate
	end if
	
end try
```

The application needs security permissions for both "Accessibility", and 
"Automation" for "System Events".


On 2023-01-08, at 23:52 +1300, John Carter Wood <woodjo-ZOsAvrTRSvuEhhMi0yms2Q@public.gmane.org> 
wrote:

> I use Zotero with BetterBibTeX (BBT) to manage my references and 
> generate
> .bib / .json files.
>
> For text editing I use Emacs to write in Markdown and have 
> incorporated
> helm-bibtex to allow me to enter citations easily:
> https://github.com/tmalsburg/helm-bibtex
>
> I'm not certain that this kind of set-up will solve your problem (as I 
> use
> pretty standard Zotero styles for my citekeys), but as others have 
> noted,
> BBT allows you to change the formatting of citekeys. I haven't 
> experimented
> too much with helm-bibtex, but it works well with Emacs. Emacs is kind 
> of a
> world in itself to get into, but I am comforted at least by the 
> probability
> that it won't disappear any time soon and I can continue using my 
> hard-won
> knowledge till at least the end of my academic career. :-)
>
> pedro....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org schrieb am Samstag, 7. Januar 2023 um 18:34:14 
> UTC+1:
>
>>> One related problem I run into with other options, is that I often 
>>> have
>> one author with multiple books which can make searching through 
>> citekeys
>> difficult. For instance I may have 5 cite keys listed as @foo123, 
>> @foo345,
>> @foo678, etc. So if, when searching, it could display the author name 
>> and
>> book, and then insert the citekey that would be the best!
>>
>> On Zotero, the BetterBibTeX plugin allows you to customize the 
>> citekey to
>> be exported in the .bib file. This way you can use something like
>> `@author:2010firstwordoftitle` to make it easier to find what you 
>> need.
>>
>> Em sexta-feira, 8 de setembro de 2017 às 18:15:34 UTC+1, MK 
>> escreveu:
>>
>>> I've been using a number of different writing programs recently, and 
>>> each
>>> time I make a switch I always run into the same problem, how to 
>>> easily
>>> insert citations. Most recently I've been satisfied with Sublime 
>>> Text and
>>> this plugin <https://github.com/sjpfenninger/citebibtex> that reads 
>>> my
>>> .bib file and easily inserts the pandoc citation. Now I'm fiddling 
>>> with
>>> Ulysses, and I've run into the problem again: how to easily access 
>>> and
>>> insert my citations. I plan on continuing to use a .bib file and 
>>> convert
>>> with pandoc.
>>>
>>> Since I use Launchbar, I thought that if there were a way to search
>>> through my .bib file with that and insert my citation, this would 
>>> make the
>>> issues disappear. However, I'm really not sure how to do it. 
>>> Essentially
>>> I'm looking for the same functionality of that plugin just not tied 
>>> to
>>> sublime text. Any thoughts would be appreciated!
>>>
>>> One related problem I run into with other options, is that I often 
>>> have
>>> one author with multiple books which can make searching through 
>>> citekeys
>>> difficult. For instance I may have 5 cite keys listed as @foo123, 
>>> @foo345,
>>> @foo678, etc. So if, when searching, it could display the author 
>>> name and
>>> book, and then insert the citekey that would be the best!
>>>
>>> PS I've seen some options such as this one by David Sanson
>>> <https://github.com/dsanson/bibdesk-pandoc-export-templates> which 
>>> uses
>>> bibdesk, and this one which uses text expander
>>> <https://github.com/andrewheiss/pandoc-citekeys>, both of which I've
>>> found a little awkward.
>>>
>>
>
> -- 
> You received this message because you are subscribed to the Google 
> Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/4e64b509-7781-4511-856c-723daf2aae4fn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/3D58E4FE-7D6B-4012-A0D9-32C0C40985CF%40gmail.com.

[-- Attachment #2: Type: text/html, Size: 9072 bytes --]

      parent reply	other threads:[~2023-01-08 20:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 17:15 Mendel Kranz
     [not found] ` <97a91bc5-d1da-45ba-8763-1617c8760f88-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-17 14:50   ` iandol
     [not found]     ` <a422ae0b-1a19-4c4f-82a0-048a71e9c3c9-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-20 22:03       ` Mendel Kranz
     [not found]         ` <948aa732-6996-44b2-a400-8798e5ba3f61-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-06 12:54           ` J
     [not found]             ` <c8032379-cd82-4001-93ba-1e155b364bcdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-06 16:05               ` Albert Krewinkel
     [not found]                 ` <875ydj4osy.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2023-01-06 17:03                   ` Joseph Reagle
2023-01-07 17:34   ` Pedro P. Palazzo
     [not found]     ` <e4b2b848-8b7f-4f8d-ade5-0ddc1b95fc42n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-08 10:52       ` John Carter Wood
     [not found]         ` <4e64b509-7781-4511-856c-723daf2aae4fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-08 20:36           ` John Purnell [this message]

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

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

  git send-email \
    --in-reply-to=3D58E4FE-7D6B-4012-A0D9-32C0C40985CF@gmail.com \
    --to=johno108108-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /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.
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 NNTP newsgroup(s).