Scannable cite "RTF/ODF Scan for Zotero" - how are the citation texts produced
Hello @adamsmith,
I wonder how the plugin "RTF/ODF Scan for Zotero" produces the scannable cite, i.e. the actual { ... | ... } text.
Zotero has a bunch of styles, of course, which are in the styles directory. Under Export -> Quick Copy, these are available. However, under Quick Copy there are other export formats available too, including 'scannable cite', which includes the group and key (which I am keen on).
(1) I assume it's not possible to get the group and the key within an ordinately .csl? I.e. the .csl processor doesn't have access to this?
(2) Is it possible to configure the generaten strings? I.e. in stead of { ... | ... } have another type of markup, say [[ ... | ... ]] for arguments sake.
Thanks!
I wonder how the plugin "RTF/ODF Scan for Zotero" produces the scannable cite, i.e. the actual { ... | ... } text.
Zotero has a bunch of styles, of course, which are in the styles directory. Under Export -> Quick Copy, these are available. However, under Quick Copy there are other export formats available too, including 'scannable cite', which includes the group and key (which I am keen on).
(1) I assume it's not possible to get the group and the key within an ordinately .csl? I.e. the .csl processor doesn't have access to this?
(2) Is it possible to configure the generaten strings? I.e. in stead of { ... | ... } have another type of markup, say [[ ... | ... ]] for arguments sake.
Thanks!
2) In the export translator -- sure. That's easy; you can do most anything (as long as it's plain text). But you'd then obviously also have to rewrite the scanning code, which is a good bit more involved. Rather than "for arguments sake" -- what specifically are you after in terms of a user story?
There are two use cases, both to do with literature reviews. I tend to use Zotero as an information manager (as many of us do, right?). For reviews (but also for other things), I therefore start from Zotero, organise information, and then write a section. The advantage od scannable cite is that I can get something that I can produce in Zotero (like any citation) but that also has the link back to Zotero: 'zg'. If I went through 'add reference' dialogue, I'd first have to copy e.g. a quote from Zotero, then in the word processor find the same reference (kind of) - I guess it's the rationale for scannable cite in the first place (and citekeys in general?).
Now the use cases, which relate to google docs:
(1) If I copy a citation, e.g.
{ | Auth (Year) | | |zg:111:222}, it stands out a little, and the '{' is not all that safe, in terms of being typed accidentally. (a) For me, a default paste as {|Auth (Year)|||zg:111:222} would be better, but (b) even better would be another unicode bracket, and e.g. pasting ❲Auth, Year|111:222❳ stands out less, and would be acceptable to others in Google docs, and ❲...❳ will not occur. Moreover, I have fragments of a Google Apps Script, that could programmatically turn these refs into links, and if required turn them back.
(This is a bit convoluted, but would fit my workflow, hence another reason: Before we export to word, we turn them all back, run a google docs script to remove the zg:... (but collate it), then use the API to check that we have everything in the bibliography. May seem convoluted, but it allows us to check coverage of refs including what refs actually used, etc. So it's a lot more flexible than just adding refs the standard way.)
Now ❲...❳ os not that important - working with {...} is fine, but {...} without spaces would be good i.e. {|Auth (Year)|||zg:111:222}, would be great. as it's less disruptive to co-workers.
(2) The 2nd use case relates to ZotFile - it's not directly to do with scannable cite, but make me think about it. Following @bwiernik I love ZotFile even more. I would love for ZotFile to have the option for a scannable cite as part of it's formatting options (e.g. %(scannableDefault), %(scannableAlternative)). At the moment, when you paste a citation (which has a zotero:// link) into Google docs, the link just gets removed, which is a shame. (That would be different if it was an http link.) I.e. I would love for ZotFile to have %(scannableDefault) (maybe with an option to set the format, e.g. {...} and ❲...❳ format, or a {...} format with no spaces) that insert a scannable ref (in addition or instead of the default ref to PDF, i.e. the default ref would become %(link) or so).
Seeing as you asked for use cases... (3) (e.g. Zutilo) More generally, I would also love an exporter that generates an http link, that opens an item in Zotero, i.e. an http link like http://127.0.0.1:23119/.../selectItems/.../MEBM3FIW (see https://forums.zotero.org/discussion/74975/alternative-to-zotero-protocol-as-direct-http-request-so-it-works-in-google-docs#latest). Not sure it's possible with the Zotero client api even.
I do think that this is really valuable. We often have remote working teams, and I go: Can you just look at, uhm, ... well, search for 'author', no it's the 2016 one. Or I end up pasting the citation in to the chat or email. Instead, I would love to be able to paste http://127.0.0.1:23119/.../selectItems/.../MEBM3FIW.
I'd be happy to paste that as a plain text link, but even better I would like for Zotero to be able to produce html/rtf formatted exports, so that (a) instead of {...} I could export a properly formatted link and (b) when sharing http://127.0.0.1:23119/.../selectItems/.../MEBM3FIW it could be formatted as a link, with text "open".
Do you know what exporting html/rtf is not possible?
For 1: parentheses are too common as occurrences in text to be useful for scanning. But have you tried whether Scannable Cite works without spaces in the markers? I didn't think we cared about those (and it'd be trivial to remove them from the generated format).
For 1:
The parenthesis aren't (...) but ❲...❳, a separate UTF character :) Hence they'd work nicely for scanning, even if {...} was needed to be used (e.g. in mathematical writing). But they are harder to type of course. I would love an option to be able to set the 'opening and closing' characters.
I don't know whether scannable cite (e.g. in OO) works, and I don't mind, as I don't use it in my workflow :). But - if there was an option to disable the spaces in the standard format produced, that would be really helpful to me!
But anyway, the scannable cite translator is trivially simple javascript -- if you look at it, I'm pretty sure you'll find modifying it quite easy, even without knowing basically any js.
Basically, using the above translator as well as the amended version of ZotFile, it's now possible to also produce 'quotation + scannable cite' (via ZotFiile) in addition to just 'scannable cites' (directly from Zotero items as always). Likewise, it's possible to produce other 'scannable-cite-like formats' (such as 'Bjoern's citation strings'), as 'quotation + scannable-cite-like cite' (via ZotFiile) and 'scannable-cite-like citatation' (via the 'Bjoerns Citation String.js' translator, which is essentially the same as the scannable cite translator).