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!
  • 1) Correct. It's an export translator (like bibtex or Zotero RDF). CSL wouldn't be able to do this.
    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?
  • Hello @adamsmith, thank you for the quick answer!

    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?
  • 2 and 3 are mostly beyond my expertise and I'm also having a hard time following (though note that html _is_ plain text. Zotero exporters can absolutely generate html and can be specified to generate href links; technically RTF is plain text, too, but it's too complex to be realistic to generate from scratch).

    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).
  • Regarding 2/3 - Sure, html is plain text, but I'd want rendered html, so it can be pasted. In the past I converted html/text snippets into rtf snippets and then pasted, but it's awkward. So would nice to have Zotero produce (e.g.) html, but then specify to put it through a conversation (I don't know whether you're on os x, but pbcopy/pbpaste have options to decide how to paste, i.e. as text or rtf.)

    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!
  • I guess then I'm confused why you want scannable cites at all. Why not just use Zotero select links or Zotero item URIs?

    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.
  • edited December 12, 2018
    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.
    The translator is not in the translators directory, right? So I'd have to fetch it the plugin code and create another plugin?
    I guess then I'm confused why you want scannable cites at all. Why not just use Zotero select links or Zotero item URIs?
    Sure! Basically, I'd like to get a citation (APA or otherwise), with link back to Zotero (in one action). As I cannot get that (as far as I see), I'd like a scannable cite (which has both a citation, as well as the link). Let me know if you see another way.
  • edited December 12, 2018
    If you have the add-on installed, it's in the translators directory. If you don't, you can find it here: https://github.com/Juris-M/zotero-odf-scan-plugin/blob/master/resource/translators/Scannable Cite.js There's no need for an add-on. Simply placing it into the translators directory and restarting is all you need for Zotero to pick it up.
    Sure! Basically, I'd like to get a citation (APA or otherwise), with link back to Zotero (in one action).
    oh I didn't realize you wanted the short citation in there too. Yeah, I'd start with Scannable Cite and modify as you need. If anything, the translator is more complex than it needs to be because it has some additional code for getting short law cites right.
  • Perfect, thank you! Found the translator, and have adapted it - straight forward. Thank you so much!
  • @bjohas -- since you have it public, if you could edit the filename and name of the translator? I'd prefer for it to be very clear that these cites are _not_ in fact scannable, at least not by the ODF Scan tool.
  • Also see discussion here: https://forums.zotero.org/discussion/74966/zotfile-extracting-more-features-of-annotations

    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).
Sign In or Register to comment.