Personalising BibDesk : citekeys, template and restore the default preferences

Maith Egeek
3 min readMay 19, 2021

BibDesk is the software I use to manage my bibliography, my list of all scientific publications. It is a software available for macOS and it is also bundled with TexShop, the software to write latex. My BibDesk current version is 1.8.2.

BibDesk is very good for personalising to your needs. For instance you can tell it to create citekeys of your publications and to export your citations according to your preferred format using templates. No worries in toying with these preferences, you can always restore the default preferences.

Automatic Citekey with BibDesk

Citekeys are unique ids for each bibliography entry (article). They can be generated automatically, following a pre-set rule.

I ‘d like to change the default setting to shorter citekeys, and more standard ways. So I changed in the menu Preferences > Cite Key Format > Format String and clicked on Advanced. For Preset Format, I selected Custom and For Format String I input %p1%Y%c{Journal}%c{Booktitle}%w{Chapter}[]3. You can build little by little your own format by using the menu below “Choose a format specifier to add” which will tell you the keyword to add in the Format String.

My format will output the following cite key format.

And to keep files coherent, I changed the autofile preferences (Format String %f{Cite Key}%n0%e)

BibDesk template

To export the citations using templates with the bibliography manager BibDesk, you can create your own template using a script style. However, the documentation about the syntax and the token names is not so accessible.

I managed to create a few personalised templates. Once these files are created, you just need to go to the menu Preferences> Template files > General templates, then press the “+” button. Then choose a name for your template, a file type (txt or html for the exemples below).

Add a General template to export citations

The first one exports a simple text; I just created a file named textServiceTemplate.txt which content is :

<$publications>
<$authors.abbreviatedNormalizedName.stringByRemovingTeX.@componentsJoinedByCommaAndAnd/> <$fields.Year.parenthesizedStringIfNotEmpty.stringByAppendingFullStopIfNotEmpty/> <$fields.Title.stringByRemovingTeX/>, <$fields.Booktitle/><$fields.Howpublished/><$fields.Journal.stringByAppendingCommaAndSpaceIfNotEmpty/><$fields.Volume.stringByPrependingCommaAndSpaceIfNotEmpty/><$fields.Number.parenthesizedStringIfNotEmpty.stringByPrependingCommaAndSpaceIfNotEmpty/><$fields.Pages.stringByPrependingCommaAndSpaceIfNotEmpty/>.
</$publications>

The second one exports as html text; I created a file name htmlItemPublication.html which content is :

<$publications>
<li class=”publication”> <span class=”new”> <$authors.name.@componentsJoinedByCommaAndAnd/> (<$fields.Year/>),
<a onClick=”_gaq.push([‘_trackEvent’, ‘Downloads’, ‘PDF’, ‘<$citeKey/>.pdf’]);window.open(this.href);return false;” class=”title” title=”<$citeKey/>.pdf” href=”publication/<$citeKey/>.pdf”> <$fields.Title/></a>,
<$fields.Howpublished.stringByAppendingFullStopAndSpaceIfNotEmpty/><$fields.Booktitle.stringByAppendingFullStopAndSpaceIfNotEmpty/><$fields.Journal.stringByAppendingCommaAndSpaceIfNotEmpty/><$fields.Volume.stringByAppendingCommaAndSpaceIfNotEmpty/><$fields.Number.parenthesizedStringIfNotEmpty.stringByAppendingCommaAndSpaceIfNotEmpty/><$fields.Pages/>
[
<a class= “bibPub” onClick=”_gaq.push([‘_trackEvent’, ‘Download’, ‘Bib’, ‘<$citeKey/>’]);window.open(this.href);return false;” title=”download bibtex file” href=”publication/<$citeKey/>.bib”>bib</a>
<a class=”vidPub” onClick=”_gaq.push([‘_trackEvent’, ‘Play’, ‘Video’, ‘<$citeKey/>’]);window.open(this.href);return false;” title=”<$citeKey/>.mp4" href=”publication/<$citeKey/>.mp4">video</a>
<a class= “youtubePub” onClick=”_gaq.push([‘_trackEvent’, ‘Play’, ‘Youtube’, ‘<$citeKey/>’]);window.open(this.href);return false;” title=”https://www.youtube.com/watch?v=cN9eBaUpqWE" href=”https://www.youtube.com/watch?v=cN9eBaUpqWE">youtube</a>
<a class= “codePub” onClick=”_gaq.push([‘_trackEvent’, ‘Downloads’, ‘Src’, ‘<$citeKey/>.src’]);window.open(this.href);return false;” title=”download source code” href=”<$citeKey/>” >code</a>
]
</span></li>
</$publications>

Restore the Preferences of BibDesk

If you made a mistake and wrote erroneous settings in Preferences, you can always reset to the default values. In each menu of the Preferences, you can see a Reset button to reset the preferences of that specific menu, and a Reset All button to rest the preferences of all menus.

However, sometimes your mistakes can result in BibDesk not starting up and crashing, and thus you I could not even access to the Preferences pane to correct my mistake.

Fortunately you can edit the preferences directly by changing the file ~/Library/Preferences/edu.ucsd.cs.mmccrack.bibdesk.plist.

More general information can be read in http://manytricks.com/blog/?p=3049.

--

--