Is it possible to add a field for "zotero://select" link in an edited style?
I'm editing a style for my personal use, and it would be useful to me to add a field in bibliography for the "zotero://select" link leading back to the item in my zotero library. Is this possible?
For example, I want a style that will output something like this:
Beaumont, Matthew. Utopia Ltd.: Ideologies of Social Dreaming in England, 1870-1900. Leiden: Brill, 2005. zotero://select/library/items/88NSHEZ2
Darko Suvin, Metamorphoses of Science Fiction: On the Poetics and History of a Literary Genre (New Haven: Yale University Press, 1979). zotero://select/library/items/MESH7QUT
For example, I want a style that will output something like this:
Beaumont, Matthew. Utopia Ltd.: Ideologies of Social Dreaming in England, 1870-1900. Leiden: Brill, 2005. zotero://select/library/items/88NSHEZ2
Darko Suvin, Metamorphoses of Science Fiction: On the Poetics and History of a Literary Genre (New Haven: Yale University Press, 1979). zotero://select/library/items/MESH7QUT
When I'm actively writing and editing my manuscripts it would be incredibly helpful if there was an easy way to turn my citations into interactive hyperlinks that point to the Zotero entry or the PDF document itself.
I was hoping it would be possible to use CSL to format any citation such that it automatically includes a Zotero:// select link.
***
@rebelprincenyc, in the meantime, would you be able to share the Zutilo workaround you're using?
I took two different approaches to creating the CSL style. First I created a modified version of
better-bibtex-citekeys.csl
by @emilianoheyns. It only involved one small modification: in the group containing the variablecitation-key
, I changed the value of a text field from@
tozotero://select/items/@
. When I rendered this using either Marked 2 or VSCode's markdown preview window, no citekey appeared in the rendered output. It's returning errors saying ie. "[WARNING] Citeproc: Citation with no printed form: marx1990_Capi".Next I tried a different approach. I made a style from scratch using the visual style editor. I'm pasting it's code below.
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never">
<info>
<title>zotero select link</title>
<id>http://www.zotero.org/styles/zotero-select-link</id>
<link rel="self" href="http://www.zotero.org/styles/zotero-select-link"/>
<updated>2022-08-10T20:00:00</updated>
</info>
<citation>
<layout>
<group text-decoration="underline">
<text variable="citation-key" font-style="normal" font-weight="normal" prefix="zotero://select/items/@"/>
</group>
</layout>
</citation>
<bibliography>
<layout>
<text variable="citation-key"/>
</layout>
</bibliography>
</style>
This style renders correctly in Zotero's internal Style Preview window. But when I use it with pandoc, the citations don't render at all. They're invisible, and pandoc is returning the same error message that I described above.
.bib
file for my references to a "Better CSL JSON" file.I found this solution via Denis on the pandoc mailing list, who writes
In any case, two comments:
1.) You can't tweak the CSL's, but you can tweak the export formats to look like formatted citations AND add code to add the link. Then when setting Preferences-> Export -> Item format to your new customized "Export format", you can drag-n-drop your citation to eg an external note program that includes a clickable link to the citation in Zotero.
2.) A (non-documented?) feature just out of the blue. When you add an annotation (image or text) and drag that annotation to an external note program - Zotero natively includes all that is missing when drag-n-drop from the library proper and leaves you with something like this:
[image] ([pdf](zotero://open-pdf/groups/1554708/items/QYULQNBG?page=4&annotation=ESQMFU4F))
([Morandi et al., 2019, p. 913](zotero://select/groups/1554708/items/K3T2AL3B))
I.e. would be cool if what ever it is doing here would get natively implemented to the usual Preferences-> Export -> Item format way of doing things.
Cheers